home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_imlib.idb / usr / freeware / src / imlib / patches.z / patches
Encoding:
Text File  |  1999-07-21  |  108.0 KB  |  3,123 lines

  1. --- ./configure.in    Wed Feb 24 10:55:27 1999
  2. +++ ../imlib-1.9.4/./configure.in    Wed Apr  7 16:43:35 1999
  3. @@ -24,13 +24,17 @@
  4.    GDK_IMLIB="" 
  5.    AC_MSG_WARN([*** gdk_imlib will not be built ***])])
  6.  
  7. +if test "x$GLIB_CONFIG" == x; then
  8. +  GLIB_CONFIG=glib-config
  9. +fi
  10. +
  11.  dynworks=false
  12.  if test "x$GDK_IMLIB" != x; then
  13.    AC_MSG_CHECKING(If dynamic linking works on this system)
  14.    oLIBS="$LIBS"
  15.    oCFLAGS="$CFLAGS"
  16. -  LIBS="$LIBS `glib-config --libs gmodule`"
  17. -  CFLAGS="$CFLAGS `glib-config --cflags gmodule`"
  18. +  LIBS="$LIBS `$GLIB_CONFIG --libs gmodule`"
  19. +  CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gmodule`"
  20.    AC_TRY_RUN([
  21.  #include <glib.h>
  22.  #include <gmodule.h>
  23. @@ -61,8 +65,8 @@
  24.  
  25.  if $dynworks; then
  26.     AC_DEFINE(USE_GMODULE)
  27. -   GMODULE_LIBS="`glib-config --libs gmodule`"
  28. -   GMODULE_FLAGS="`glib-config --cflags gmodule`"
  29. +   GMODULE_LIBS="`$GLIB_CONFIG --libs gmodule`"
  30. +   GMODULE_FLAGS="`$GLIB_CONFIG --cflags gmodule`"
  31.     AC_SUBST(GMODULE_LIBS)
  32.     AC_SUBST(GMODULE_FLAGS)
  33.     AC_MSG_RESULT(yes)
  34. --- ./ltmain.sh    Wed Feb 24 10:46:18 1999
  35. +++ ../imlib-1.9.4/./ltmain.sh    Wed Apr 14 16:12:40 1999
  36. @@ -49,8 +49,8 @@
  37.  # Constants.
  38.  PROGRAM=ltmain.sh
  39.  PACKAGE=libtool
  40. -VERSION=1.2e
  41. -TIMESTAMP=" (1.255 1999/01/28 13:33:31)"
  42. +VERSION=1.2f
  43. +TIMESTAMP=" (1.385 1999/03/15 17:24:54)"
  44.  
  45.  default_mode=
  46.  help="Try \`$progname --help' for more information."
  47. @@ -431,14 +431,14 @@
  48.        # All platforms use -DPIC, to notify preprocessed assembler code.
  49.        command="$base_compile $pic_flag -DPIC $srcfile"
  50.        if test "$build_old_libs" = yes; then
  51. -        lo_libobj="$libobj"
  52. +    lo_libobj="$libobj"
  53.      dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  54.      if test "X$dir" = "X$libobj"; then
  55.        dir="$objdir"
  56.      else
  57.        dir="$dir/$objdir"
  58.      fi
  59. -        libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  60. +    libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  61.  
  62.      if test -d "$dir"; then
  63.        $show "$rm $libobj"
  64. @@ -501,7 +501,7 @@
  65.        # If we have no pic_flag, then copy the object into place and finish.
  66.        if test -z "$pic_flag" && test "$build_old_libs" = yes; then
  67.      # Rename the .lo from within objdir to obj
  68. -        if test -f $obj; then
  69. +    if test -f $obj; then
  70.        $show $rm $obj
  71.        $run $rm $obj
  72.      fi
  73. @@ -580,8 +580,8 @@
  74.        # Create an invalid libtool object if no PIC, so that we do not
  75.        # accidentally link it into a program.
  76.        if test "$build_libtool_libs" != yes; then
  77. -        $show "echo timestamp > $libobj"
  78. -        $run eval "echo timestamp > \$libobj" || exit $?
  79. +    $show "echo timestamp > $libobj"
  80. +    $run eval "echo timestamp > \$libobj" || exit $?
  81.        else
  82.      # Move the .lo from within objdir
  83.      $show "$mv $libobj $lo_libobj"
  84. @@ -608,7 +608,7 @@
  85.      C_compiler="$CC" # save it, to compile generated C sources
  86.      CC="$nonopt"
  87.      case "$host" in
  88. -    *-*-cygwin32* | *-*-mingw32* | *-*-os2*)
  89. +    *-*-cygwin* | *-*-mingw* | *-*-os2*)
  90.        # It is impossible to link a dll without this setting, and
  91.        # we shouldn't force the makefile maintainer to figure out
  92.        # which system we are compiling for in order to pass an extra
  93. @@ -643,6 +643,138 @@
  94.  #   return TRUE;
  95.  # }
  96.  # /* ltdll.c ends here */
  97. +      # This is a source program that is used to create import libraries
  98. +      # on Windows for dlls which lack them. Don't remove nor modify the
  99. +      # starting and closing comments
  100. +# /* impgen.c starts here */
  101. +# /*   Copyright (C) 1999 Free Software Foundation, Inc.
  102. +# 
  103. +#  This file is part of GNU libtool.
  104. +# 
  105. +#  This program is free software; you can redistribute it and/or modify
  106. +#  it under the terms of the GNU General Public License as published by
  107. +#  the Free Software Foundation; either version 2 of the License, or
  108. +#  (at your option) any later version.
  109. +# 
  110. +#  This program is distributed in the hope that it will be useful,
  111. +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
  112. +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  113. +#  GNU General Public License for more details.
  114. +# 
  115. +#  You should have received a copy of the GNU General Public License
  116. +#  along with this program; if not, write to the Free Software
  117. +#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  118. +#  */
  119. +# 
  120. +#  #include <stdio.h>        /* for printf() */
  121. +#  #include <unistd.h>        /* for open(), lseek(), read() */
  122. +#  #include <fcntl.h>        /* for O_RDONLY, O_BINARY */
  123. +#  #include <string.h>        /* for strdup() */
  124. +# 
  125. +#  static unsigned int
  126. +#  pe_get16 (fd, offset)
  127. +#       int fd;
  128. +#       int offset;
  129. +#  {
  130. +#    unsigned char b[2];
  131. +#    lseek (fd, offset, SEEK_SET);
  132. +#    read (fd, b, 2);
  133. +#    return b[0] + (b[1]<<8);
  134. +#  }
  135. +# 
  136. +#  static unsigned int
  137. +#  pe_get32 (fd, offset)
  138. +#      int fd;
  139. +#      int offset;
  140. +#  {
  141. +#    unsigned char b[4];
  142. +#    lseek (fd, offset, SEEK_SET);
  143. +#    read (fd, b, 4);
  144. +#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  145. +#  }
  146. +# 
  147. +#  static unsigned int
  148. +#  pe_as32 (ptr)
  149. +#       void *ptr;
  150. +#  {
  151. +#    unsigned char *b = ptr;
  152. +#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  153. +#  }
  154. +# 
  155. +#  int
  156. +#  main (argc, argv)
  157. +#      int argc;
  158. +#      char *argv[];
  159. +#  {
  160. +#      int dll;
  161. +#      unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
  162. +#      unsigned long export_rva, export_size, nsections, secptr, expptr;
  163. +#      unsigned long name_rvas, nexp;
  164. +#      unsigned char *expdata, *erva;
  165. +#      char *filename, *dll_name;
  166. +# 
  167. +#      filename = argv[1];
  168. +# 
  169. +#      dll = open(filename, O_RDONLY|O_BINARY);
  170. +#      if (!dll)
  171. +#      return 1;
  172. +# 
  173. +#      dll_name = filename;
  174. +#    
  175. +#      for (i=0; filename[i]; i++)
  176. +#      if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
  177. +#          dll_name = filename + i +1;
  178. +# 
  179. +#      pe_header_offset = pe_get32 (dll, 0x3c);
  180. +#      opthdr_ofs = pe_header_offset + 4 + 20;
  181. +#      num_entries = pe_get32 (dll, opthdr_ofs + 92);
  182. +# 
  183. +#      if (num_entries < 1) /* no exports */
  184. +#      return 1;
  185. +# 
  186. +#      export_rva = pe_get32 (dll, opthdr_ofs + 96);
  187. +#      export_size = pe_get32 (dll, opthdr_ofs + 100);
  188. +#      nsections = pe_get16 (dll, pe_header_offset + 4 +2);
  189. +#      secptr = (pe_header_offset + 4 + 20 +
  190. +#            pe_get16 (dll, pe_header_offset + 4 + 16));
  191. +# 
  192. +#      expptr = 0;
  193. +#      for (i = 0; i < nsections; i++)
  194. +#      {
  195. +#      char sname[8];
  196. +#      unsigned long secptr1 = secptr + 40 * i;
  197. +#      unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
  198. +#      unsigned long vsize = pe_get32 (dll, secptr1 + 16);
  199. +#      unsigned long fptr = pe_get32 (dll, secptr1 + 20);
  200. +#      lseek(dll, secptr1, SEEK_SET);
  201. +#      read(dll, sname, 8);
  202. +#      if (vaddr <= export_rva && vaddr+vsize > export_rva)
  203. +#      {
  204. +#          expptr = fptr + (export_rva - vaddr);
  205. +#          if (export_rva + export_size > vaddr + vsize)
  206. +#          export_size = vsize - (export_rva - vaddr);
  207. +#          break;
  208. +#      }
  209. +#      }
  210. +# 
  211. +#      expdata = (unsigned char*)malloc(export_size);
  212. +#      lseek (dll, expptr, SEEK_SET);
  213. +#      read (dll, expdata, export_size);
  214. +#      erva = expdata - export_rva;
  215. +# 
  216. +#      nexp = pe_as32 (expdata+24);
  217. +#      name_rvas = pe_as32 (expdata+32);
  218. +# 
  219. +#      printf ("EXPORTS\n");
  220. +#      for (i = 0; i<nexp; i++)
  221. +#      {
  222. +#      unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
  223. +#      printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
  224. +#      }
  225. +# 
  226. +#      return 0;
  227. +#  }
  228. +# /* impgen.c ends here */
  229.        ;;
  230.      *)
  231.        allow_undefined=yes
  232. @@ -651,6 +783,8 @@
  233.      compile_command="$CC"
  234.      finalize_command="$CC"
  235.  
  236. +    compile_rpath=
  237. +    finalize_rpath=
  238.      compile_shlibpath=
  239.      finalize_shlibpath=
  240.      convenience=
  241. @@ -662,19 +796,20 @@
  242.        # get the directories listed in $shlibpath_var
  243.        eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  244.      else
  245. -      libsearch_path=
  246. +      lib_search_path=
  247.      fi
  248.      # now prepend the system-specific ones
  249.      eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
  250. +    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  251.      
  252.      avoid_version=no
  253.      dlfiles=
  254.      dlprefiles=
  255. +    dlself=no
  256.      export_dynamic=no
  257.      export_symbols=
  258. +    export_symbols_regex=
  259.      generated=
  260. -    hardcode_libdirs=
  261. -    finalize_hardcode_libdirs=
  262.      libobjs=
  263.      link_against_libtool_libs=
  264.      ltlibs=
  265. @@ -688,7 +823,6 @@
  266.      xrpath=
  267.      perm_rpath=
  268.      temp_rpath=
  269. -    finalize_rpath=
  270.      thread_safe=no
  271.      vinfo=
  272.  
  273. @@ -734,6 +868,15 @@
  274.        fi
  275.        case "$arg" in
  276.        *.la | *.lo) ;;  # We handle these cases below.
  277. +      self)
  278. +        if test "$prev" = dlprefiles; then
  279. +          dlself=yes
  280. +        elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  281. +          dlself=yes
  282. +        fi
  283. +        prev=
  284. +        continue
  285. +        ;;
  286.        *)
  287.          dlprefiles="$dlprefiles $arg"
  288.          test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
  289. @@ -741,13 +884,19 @@
  290.          ;;
  291.        esac
  292.        ;;
  293. -    exportsyms)
  294. +    expsyms)
  295.        export_symbols="$arg"
  296.        if test ! -f "$arg"; then
  297.          $echo "$modename: symbol file \`$arg' does not exist"
  298.          exit 1
  299.        fi
  300.        prev=
  301. +      continue
  302. +      ;;
  303. +    expsyms_regex)
  304. +      export_symbols_regex="$arg"
  305. +      prev=
  306. +      continue
  307.        ;;
  308.      release)
  309.        release="-$arg"
  310. @@ -779,6 +928,7 @@
  311.      if test -n "$link_static_flag"; then
  312.        compile_command="$compile_command $link_static_flag"
  313.        finalize_command="$finalize_command $link_static_flag"
  314. +      dlopen_self=$dlopen_self_static
  315.      fi
  316.      continue
  317.      ;;
  318. @@ -812,21 +962,19 @@
  319.        else
  320.          arg=
  321.        fi
  322. -      if test "$preload" = no; then
  323. -        # Add the symbol object into the linking commands.
  324. -        compile_command="$compile_command @SYMFILE@"
  325. -        finalize_command="$finalize_command @SYMFILE@"
  326. -        preload=yes
  327. -      fi
  328.      fi
  329.      ;;
  330.  
  331. -      -export-symbols)
  332. -    if test -n "$export_symbols"; then
  333. +      -export-symbols | -export-symbols-regex)
  334. +    if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  335.        $echo "$modename: cannot have more than one -exported-symbols"
  336.        exit 1
  337.      fi
  338. -    prev=exportsyms
  339. +    if test "$arg" = "-export-symbols"; then
  340. +      prev=expsyms
  341. +    else
  342. +      prev=expsyms_regex
  343. +    fi
  344.      continue
  345.      ;;
  346.  
  347. @@ -841,17 +989,22 @@
  348.        exit 1
  349.        ;;
  350.      esac
  351. -    deplibs="$deplibs $arg"
  352. -    lib_search_path="$lib_search_path `expr $arg : '-L\(.*\)'`"
  353. +    case " $deplibs " in
  354. +    *" $arg "*) ;;
  355. +    *) deplibs="$deplibs $arg";;
  356. +    esac
  357. +    case " $lib_search_path " in
  358. +    *" $dir "*) ;;
  359. +    *) lib_search_path="$lib_search_path $dir";;
  360. +    esac
  361.      case "$host" in
  362. -    *-*-cygwin32* | *-*-mingw32* | *-*-os2*)
  363. -      dllsearchdir="`expr $arg : '-L\(.*\)'`"
  364. -      dllsearchdir=`cd "$dllsearchdir" && pwd || echo "$dllsearchdir"`
  365. -      if test -n "$dllsearchpath"; then
  366. -        dllsearchpath="$dllsearchpath:$dllsearchdir"
  367. -      else
  368. -        dllsearchpath="$dllsearchdir"
  369. -      fi
  370. +    *-*-cygwin* | *-*-mingw* | *-*-os2*)
  371. +      dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  372. +      case ":$dllsearchpath:" in
  373. +      ::) dllsearchpath="$dllsearchdir";;
  374. +      *":$dllsearchdir:"*) ;;
  375. +      *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
  376. +      esac
  377.        ;;
  378.      esac
  379.      ;;
  380. @@ -894,7 +1047,7 @@
  381.      ;;
  382.  
  383.        -R*)
  384. -    xrpath="$xrpath "`echo "X$arg" | $Xsed -e 's/^-R//'`
  385. +    xrpath="$xrpath "`$echo "X$arg" | $Xsed -e 's/^-R//'`
  386.      continue
  387.      ;;
  388.  
  389. @@ -903,6 +1056,7 @@
  390.      if test -z "$pic_flag" && test -n "$link_static_flag"; then
  391.        compile_command="$compile_command $link_static_flag"
  392.        finalize_command="$finalize_command $link_static_flag"
  393. +      dlopen_self=$dlopen_self_static
  394.      fi
  395.      continue
  396.      ;;
  397. @@ -938,7 +1092,7 @@
  398.      # A library object.
  399.      if test "$prev" = dlfiles; then
  400.        dlfiles="$dlfiles $arg"
  401. -      if test "$build_libtool_libs" = yes; then
  402. +      if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
  403.          prev=
  404.          continue
  405.        else
  406. @@ -1010,7 +1164,15 @@
  407.        temp_deplibs=
  408.        for deplib in $dependency_libs; do
  409.          case "$deplib" in
  410. -        -R*) xrpath="$xrpath "`echo "X$deplib" | $Xsed -e 's/^-R//'`;;
  411. +        -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  412. +         case " $rpath $xrpath " in
  413. +         *" $temp_xrpath "*) ;;
  414. +         *) xrpath="$xrpath $temp_xrpath";;
  415. +         esac;;
  416. +        -L*) case "$compile_command $temp_deplibs " in
  417. +         *" $deplib "*) ;;
  418. +         *) temp_deplibs="$temp_deplibs $deplib";;
  419. +         esac;;
  420.          *) temp_deplibs="$temp_deplibs $deplib";;
  421.          esac
  422.        done
  423. @@ -1030,8 +1192,8 @@
  424.      # This library was specified with -dlopen.
  425.      if test "$prev" = dlfiles; then
  426.        dlfiles="$dlfiles $arg"
  427. -      if test -z "$dlname" || test "$build_libtool_libs" = no; then
  428. -        # If there is no dlname or we're linking statically,
  429. +      if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
  430. +        # If there is no dlname, no dlopen support or we're linking statically,
  431.          # we need to preload.
  432.          prev=dlprefiles
  433.        else
  434. @@ -1066,95 +1228,40 @@
  435.          esac
  436.        fi
  437.  
  438. -      # This is the magic to use -rpath.
  439. -      if test -n "$hardcode_libdir_flag_spec"; then
  440. -        saved_libdir="$libdir"
  441. -        libdir="$dir"
  442. -
  443. -        # We need an absolute path.
  444. -        case "$libdir" in
  445. -        /* | [A-Za-z]:[/\\]*) ;;
  446. -        *)
  447. -          absdir=`cd "$libdir" && pwd`
  448. -          if test -z "$absdir"; then
  449. -        $echo "$modename: cannot determine absolute directory name of \`$libdir'" 1>&2
  450. -          else
  451. -        libdir="$absdir"
  452. -          fi
  453. -          ;;
  454. -        esac
  455. -        if test -n "$hardcode_libdir_separator"; then
  456. -          if test -z "$hardcode_libdirs"; then
  457. -        # Put the magic libdir with the hardcode flag.
  458. -        hardcode_libdirs="$libdir"
  459. -        libdir="@HARDCODE_LIBDIRS@"
  460. -          else
  461. -        # Just accumulate the unique libdirs.
  462. -        case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  463. -        *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  464. -          ;;
  465. -        *)
  466. -          hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  467. -          ;;
  468. -        esac
  469. -        libdir=
  470. -          fi
  471. -        fi
  472. -
  473. -        if test -n "$libdir"; then
  474. -          eval flag=\"$hardcode_libdir_flag_spec\"
  475. -
  476. -          compile_command="$compile_command $flag"
  477. -        fi
  478. -
  479. -        libdir="$saved_libdir"
  480. -        if test -n "$hardcode_libdir_separator"; then
  481. -          if test -z "$finalize_hardcode_libdirs"; then
  482. -        # Put the magic libdir with the hardcode flag.
  483. -        finalize_hardcode_libdirs="$libdir"
  484. -        libdir="@HARDCODE_LIBDIRS@"
  485. -          else
  486. -        # Just accumulate the unique libdirs.
  487. -        case "$hardcode_libdir_separator$finalize_hardcode_libdirs$hardcode_libdir_separator" in
  488. -        *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  489. -          ;;
  490. -        *)
  491. -          finalize_hardcode_libdirs="$finalize_hardcode_libdirs$hardcode_libdir_separator$libdir"
  492. -          ;;
  493. -        esac
  494. -        libdir=
  495. -          fi
  496. -        fi
  497. -
  498. -        if test -n "$libdir"; then
  499. -          eval flag=\"$hardcode_libdir_flag_spec\"
  500. -
  501. -          finalize_command="$finalize_command $flag"
  502. +      # We need an absolute path.
  503. +      case "$dir" in
  504. +      /* | [A-Za-z]:[/\\]*) absdir="$dir" ;;
  505. +      *)
  506. +        absdir=`cd "$dir" && pwd`
  507. +        if test -z "$absdir"; then
  508. +          $echo "$modename: cannot determine absolute directory name of \`$libdir'" 1>&2
  509. +          exit 1
  510.          fi
  511. -        # libdir is also use after "$hardcode_action" case
  512. -        libdir="$saved_libdir"
  513. -      elif test -n "$runpath_var"; then
  514. -        # Do the same for the permanent run path.
  515. -        case "$dir" in
  516. -        /* | [A-Za-z]:[/\\]*) absdir="$dir";;
  517. -        *)
  518. -          absdir=`cd "$dir" && pwd`
  519. -          if test -z "$absdir"; then
  520. -        $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  521. -        absdir="$dir"
  522. -          fi
  523. -          ;;
  524. -        esac
  525. -        case "$perm_rpath " in
  526. +        ;;
  527. +      esac
  528. +      
  529. +      # This is the magic to use -rpath.
  530. +      # Skip directories that are in the system default run-time
  531. +      # search path, unless they have been requested with -R.
  532. +      case " $sys_lib_dlsearch_path " in
  533. +       *" $absdir "*) ;;
  534. +      *)
  535. +        case "$compile_rpath " in
  536.          *" $absdir "*) ;;
  537. -        *) perm_rpath="$perm_rpath $absdir" ;;
  538. +        *) compile_rpath="$compile_rpath $absdir" 
  539.          esac
  540. -        case "$finalize_perm_rpath " in
  541. +        ;;
  542. +       esac
  543. +
  544. +      case " $sys_lib_dlsearch_path " in
  545. +       *" $libdir "*) ;;
  546. +      *)
  547. +        case "$finalize_rpath " in
  548.          *" $libdir "*) ;;
  549. -        *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  550. +        *) finalize_rpath="$finalize_rpath $libdir"
  551.          esac
  552. -      fi
  553. -
  554. +        ;;
  555. +       esac
  556.  
  557.        lib_linked=yes
  558.        case "$hardcode_action" in
  559. @@ -1163,7 +1270,7 @@
  560.            compile_command="$compile_command $dir/$linklib"
  561.            deplibs="$deplibs $dir/$linklib"
  562.            case "$host" in
  563. -          *-*-cygwin32* | *-*-mingw32* | *-*-os2*)
  564. +          *-*-cygwin* | *-*-mingw* | *-*-os2*)
  565.          dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  566.          if test -n "$dllsearchpath"; then
  567.            dllsearchpath="$dllsearchpath:$dllsearchdir"
  568. @@ -1178,10 +1285,17 @@
  569.          compile_shlibpath="$compile_shlibpath$dir:"
  570.          ;;
  571.            esac
  572. -          compile_command="$compile_command -L$dir -l$name"
  573. +          case "$compile_command " in
  574. +          *" -L$dir "*) ;;
  575. +          *) compile_command="$compile_command -L$dir";;
  576. +          esac
  577. +          compile_command="$compile_command -l$name"
  578.            deplibs="$deplibs -L$dir -l$name"
  579.          elif test "$hardcode_shlibpath_var" = no; then
  580. -          compile_shlibpath="$compile_shlibpath$dir:"
  581. +          case ":$compile_shlibpath:" in
  582. +          *":$dir:"*) ;;
  583. +          *) compile_shlibpath="$compile_shlibpath$dir:";;
  584. +          esac
  585.            compile_command="$compile_command -l$name"
  586.            deplibs="$deplibs -l$name"
  587.          else
  588. @@ -1190,27 +1304,21 @@
  589.          ;;
  590.  
  591.        relink)
  592. -        # We need an absolute path.
  593. -        case "$dir" in
  594. -        /* | [A-Za-z]:[/\\]*) ;;
  595. -        *)
  596. -          absdir=`cd "$dir" && pwd`
  597. -          if test -z "$absdir"; then
  598. -        $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  599. -        exit 1
  600. -          fi
  601. -          dir="$absdir"
  602. -          ;;
  603. -        esac
  604. -
  605.          if test "$hardcode_direct" = yes; then
  606. -          compile_command="$compile_command $dir/$linklib"
  607. -          deplibs="$deplibs $dir/$linklib"
  608. +          compile_command="$compile_command $absdir/$linklib"
  609. +          deplibs="$deplibs $absdir/$linklib"
  610.          elif test "$hardcode_minus_L" = yes; then
  611. -          compile_command="$compile_command -L$dir -l$name"
  612. -          deplibs="$deplibs -L$dir -l$name"
  613. +          case "$compile_command " in
  614. +          *" -L$absdir "*) ;;
  615. +          *) compile_command="$compile_command -L$absdir";;
  616. +          esac
  617. +          compile_command="$compile_command -l$name"
  618. +          deplibs="$deplibs -L$absdir -l$name"
  619.          elif test "$hardcode_shlibpath_var" = yes; then
  620. -          compile_shlibpath="$compile_shlibpath$dir:"
  621. +          case ":$compile_shlibpath:" in
  622. +          *":$absdir:"*) ;;
  623. +          *) compile_shlibpath="$compile_shlibpath$absdir:";;
  624. +          esac
  625.            compile_command="$compile_command -l$name"
  626.            deplibs="$deplibs -l$name"
  627.          else
  628. @@ -1232,13 +1340,24 @@
  629.        if test "$hardcode_direct" = yes; then
  630.          finalize_command="$finalize_command $libdir/$linklib"
  631.        elif test "$hardcode_minus_L" = yes; then
  632. -        finalize_command="$finalize_command -L$libdir -l$name"
  633. +        case "$finalize_command " in
  634. +        *" -L$libdir "*) ;;
  635. +        *) finalize_command="$finalize_command -L$libdir";;
  636. +        esac
  637. +        finalize_command="$finalize_command -l$name"
  638.        elif test "$hardcode_shlibpath_var" = yes; then
  639. -        finalize_shlibpath="$finalize_shlibpath$libdir:"
  640. +        case ":$finalize_shlibpath:" in
  641. +        *":$libdir:"*) ;;
  642. +        *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
  643. +        esac
  644.          finalize_command="$finalize_command -l$name"
  645.        else
  646.          # We cannot seem to hardcode it, guess we'll fake it.
  647. -        finalize_command="$finalize_command -L$libdir -l$name"
  648. +        case "$finalize_command " in
  649. +        *" -L$dir "*) ;;
  650. +        *) finalize_command="$finalize_command -L$libdir";;
  651. +        esac
  652. +        finalize_command="$finalize_command -l$name"
  653.        fi
  654.      else
  655.        # Transform directly to old archives if we don't build new libraries.
  656. @@ -1255,8 +1374,16 @@
  657.          compile_command="$compile_command $dir/$linklib"
  658.          finalize_command="$finalize_command $dir/$linklib"
  659.        else
  660. -        compile_command="$compile_command -L$dir -l$name"
  661. -        finalize_command="$finalize_command -L$dir -l$name"
  662. +        case "$compile_command " in
  663. +        *" -L$dir "*) ;;
  664. +        *) compile_command="$compile_command -L$dir";;
  665. +        esac
  666. +        compile_command="$compile_command -l$name"
  667. +        case "$finalize_command " in
  668. +        *" -L$dir "*) ;;
  669. +        *) finalize_command="$finalize_command -L$dir";;
  670. +        esac
  671. +        finalize_command="$finalize_command -l$name"
  672.        fi
  673.      fi
  674.  
  675. @@ -1292,11 +1419,6 @@
  676.        exit 1
  677.      fi
  678.  
  679. -    if test -n "$export_symbols" && test "$module" = yes; then
  680. -      $echo "$modename: \`-export-symbols' is not supported for modules"
  681. -      exit 1
  682. -    fi
  683. -    
  684.      oldlibs=
  685.      # calculate the name of the file, without its directory
  686.      outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  687. @@ -1390,8 +1512,8 @@
  688.  
  689.        # How the heck are we supposed to write a wrapper for a shared library?
  690.        if test -n "$link_against_libtool_libs"; then
  691. -           $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  692. -           exit 1
  693. +     $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  694. +     exit 1
  695.        fi
  696.  
  697.        if test -n "$dlfiles$dlprefiles"; then
  698. @@ -1480,6 +1602,20 @@
  699.      case "$version_type" in
  700.      none) ;;
  701.  
  702. +    irix)
  703. +      major=`expr $current - $age + 1`
  704. +      versuffix=".$major"
  705. +      verstring="sgi$major.$revision"
  706. +
  707. +      # Add in all the interfaces that we are compatible with.
  708. +      loop=$revision
  709. +      while test $loop != 0; do
  710. +        iface=`expr $revision - $loop`
  711. +        loop=`expr $loop - 1`
  712. +        verstring="sgi$major.$iface:$verstring"
  713. +      done
  714. +      ;;
  715. +
  716.      linux)
  717.        major=.`expr $current - $age`
  718.        versuffix="$major.$age.$revision"
  719. @@ -1563,7 +1699,7 @@
  720.  
  721.      dependency_libs="$deplibs"
  722.      case "$host" in
  723. -    *-*-cygwin32* | *-*-mingw32* | *-*-os2*)
  724. +    *-*-cygwin* | *-*-mingw* | *-*-os2*)
  725.        # these systems don't actually have a c library (as such)!
  726.        ;;
  727.      *)
  728. @@ -1716,15 +1852,14 @@
  729.                # but so what?
  730.                potlib="$potent_lib"
  731.                while test -h "$potlib" 2>/dev/null; do
  732. -                potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  733. +            potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  734.              case "$potliblink" in
  735.              /*) potlib="$potliblink";;
  736. -            *) potlib=`$echo "X$potlib" \
  737. -                   | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  738. +            *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  739.              esac
  740.                done
  741. -              if eval $file_magic_command \"\$potlib\" \
  742. -             | sed '11,$d' \
  743. +              if eval $file_magic_cmd \"\$potlib\" \
  744. +             | sed 10q \
  745.               | egrep "$file_magic_regex" > /dev/null; then
  746.              newdeplibs="$newdeplibs $a_deplib"
  747.              a_deplib=""
  748. @@ -1747,8 +1882,9 @@
  749.        done # Gone through all deplibs.
  750.        ;;
  751.      none | unknown | *) newdeplibs=""
  752. -      if $echo "X$deplibs" | $Xsed -e 's/ -lc$//' -e 's/[     ]//g' \
  753. -         | grep . >/dev/null; then
  754. +      if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  755. +           -e 's/ -[LR][^ ]*//g' -e 's/[     ]//g' |
  756. +         grep . >/dev/null; then
  757.          echo
  758.          if test "X$deplibs_check_method" = "Xnone"; then
  759.            echo "*** Warning: inter-library dependencies are not supported in this platform."
  760. @@ -1822,13 +1958,13 @@
  761.  
  762.      # Ensure that we have .o objects for linkers which dislike .lo
  763.      # (e.g. aix) incase we are running --disable-static
  764. -        for obj in $libobjs; do
  765. -          oldobj=`echo $obj | $Xsed -e "$lo2o"`
  766. -          test -f $oldobj || ${LN_S} $obj $oldobj
  767. -        done
  768. +    for obj in $libobjs; do
  769. +      oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
  770. +      test -f $oldobj || ${LN_S} $obj $oldobj
  771. +    done
  772.  
  773.      # Use standard objects if they are pic
  774. -        test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  775. +    test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  776.  
  777.      if test -n "$whole_archive_flag_spec"; then
  778.        if test -n "$convenience"; then
  779. @@ -1839,7 +1975,7 @@
  780.          # Extract the objects.
  781.          xdir="$xlib"x
  782.          generated="$generated $xdir"
  783. -        xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
  784. +        xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  785.  
  786.          $show "${rm}r $xdir"
  787.          $run ${rm}r "$xdir"
  788. @@ -1856,9 +1992,42 @@
  789.        done
  790.      fi
  791.  
  792. +    if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  793. +      eval flag=\"$thread_safe_flag_spec\"
  794. +
  795. +      linkopts="$linkopts $flag"
  796. +    fi
  797. +
  798. +    # Prepare the list of exported symbols
  799. +    if test -z "$export_symbols"; then
  800. +      if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  801. +        $show "generating symbol list for \`$libname.la'"
  802. +        export_symbols="$objdir/$libname.exp"
  803. +        $run $rm $export_symbols
  804. +        eval cmds=\"$export_symbols_cmds\"
  805. +        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  806. +        for cmd in $cmds; do
  807. +          IFS="$save_ifs"
  808. +          $show "$cmd"
  809. +          $run eval "$cmd" || exit $?
  810. +        done
  811. +        IFS="$save_ifs"
  812. +        if test -n "$export_symbols_regex"; then
  813. +          $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  814. +          $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  815. +          $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  816. +          $run eval '$mv "${export_symbols}T" "$export_symbols"'
  817. +        fi
  818. +      fi
  819. +    fi
  820. +
  821. +    if test -n "$export_symbols" && test -n "$include_expsyms"; then
  822. +      $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  823. +    fi
  824. +
  825.      # Do each of the archive commands.
  826. -    if test -n "$export_symbols" && test -n "$archive_sym_cmds"; then
  827. -      eval cmds=\"$archive_sym_cmds\"
  828. +    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  829. +      eval cmds=\"$archive_expsym_cmds\"
  830.      else
  831.        eval cmds=\"$archive_cmds\"
  832.      fi
  833. @@ -1991,77 +2160,107 @@
  834.      $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  835.        fi
  836.  
  837. +      if test "$preload" = yes; then
  838. +    if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
  839. +       test "$dlopen_self_static" = unknown; then
  840. +      $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  841. +    fi 
  842. +      fi
  843. +    
  844. +      if test "$dlself" = yes && test "$export_dynamic" = no; then
  845. +    $echo "$modename: error: \`-dlopen self' requires \`-export-dynamic'" 1>&2
  846. +    exit 1
  847. +      fi
  848. +
  849.        if test -n "$rpath$xrpath"; then
  850.      # If the user specified any rpath flags, then add them.
  851.      for libdir in $rpath $xrpath; do
  852. -      if test -n "$hardcode_libdir_flag_spec"; then
  853. -        saved_libdir="$libdir"
  854. -        if test -n "$hardcode_libdir_separator"; then
  855. -          if test -z "$hardcode_libdirs"; then
  856. -        # Put the magic libdir with the hardcode flag.
  857. -        hardcode_libdirs="$libdir"
  858. -        libdir="@HARDCODE_LIBDIRS@"
  859. -          else
  860. -        # Just accumulate the unique libdirs.
  861. -        case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  862. -        *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  863. -          ;;
  864. -        *)
  865. -          hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  866. -          ;;
  867. -        esac
  868. -        libdir=
  869. -          fi
  870. -        fi
  871. -
  872. -        if test -n "$libdir"; then
  873. -          eval flag=\"$hardcode_libdir_flag_spec\"
  874. +      # This is the magic to use -rpath.
  875. +      case "$compile_rpath " in
  876. +      *" $libdir "*) ;;
  877. +      *) compile_rpath="$compile_rpath $libdir" ;;
  878. +      esac
  879. +      case "$finalize_rpath " in
  880. +      *" $libdir "*) ;;
  881. +      *) finalize_rpath="$finalize_rpath $libdir" ;;
  882. +      esac
  883. +    done
  884. +      fi
  885.  
  886. -          compile_command="$compile_command $flag"
  887. +      # Now hardcode the library paths
  888. +      rpath=
  889. +      hardcode_libdirs=
  890. +      for libdir in $compile_rpath $finalize_rpath; do
  891. +    if test -n "$hardcode_libdir_flag_spec"; then
  892. +      if test -n "$hardcode_libdir_separator"; then
  893. +        if test -z "$hardcode_libdirs"; then
  894. +          hardcode_libdirs="$libdir"
  895. +        else
  896. +          # Just accumulate the unique libdirs.
  897. +          case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  898. +          *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  899. +        ;;
  900. +          *)
  901. +        hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  902. +        ;;
  903. +          esac
  904.          fi
  905. +      else
  906. +        eval flag=\"$hardcode_libdir_flag_spec\"
  907.  
  908. -        libdir="$saved_libdir"
  909. -        if test -n "$hardcode_libdir_separator"; then
  910. -          if test -z "$finalize_hardcode_libdirs"; then
  911. -        # Put the magic libdir with the hardcode flag.
  912. -        finalize_hardcode_libdirs="$libdir"
  913. -        libdir="@HARDCODE_LIBDIRS@"
  914. -          else
  915. -        # Just accumulate the unique libdirs.
  916. -        case "$hardcode_libdir_separator$finalize_hardcode_libdirs$hardcode_libdir_separator" in
  917. -        *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  918. -          ;;
  919. -        *)
  920. -          finalize_hardcode_libdirs="$finalize_hardcode_libdirs$hardcode_libdir_separator$libdir"
  921. -          ;;
  922. -        esac
  923. -        libdir=
  924. -          fi
  925. +        rpath="$rpath $flag"
  926. +      fi
  927. +    elif test -n "$runpath_var"; then
  928. +      case "$perm_rpath " in
  929. +      *" $libdir "*) ;;
  930. +      *) perm_rpath="$perm_rpath $libdir" ;;
  931. +      esac
  932. +    fi
  933. +      done
  934. +      # Substitute the hardcoded libdirs into the rpath.
  935. +      if test -n "$hardcode_libdir_separator" &&
  936. +     test -n "$hardcode_libdirs"; then
  937. +    libdir="$hardcode_libdirs"
  938. +    eval rpath=\" $hardcode_libdir_flag_spec\"
  939. +      fi
  940. +      compile_rpath="$rpath"
  941. +
  942. +      rpath=
  943. +      hardcode_libdirs=
  944. +      for libdir in $finalize_rpath; do
  945. +    if test -n "$hardcode_libdir_flag_spec"; then
  946. +      if test -n "$hardcode_libdir_separator"; then
  947. +        if test -z "$hardcode_libdirs"; then
  948. +          hardcode_libdirs="$libdir"
  949. +        else
  950. +          # Just accumulate the unique libdirs.
  951. +          case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  952. +          *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  953. +        ;;
  954. +          *)
  955. +        hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  956. +        ;;
  957. +          esac
  958.          fi
  959. +      else
  960. +        eval flag=\"$hardcode_libdir_flag_spec\"
  961.  
  962. -        if test -n "$libdir"; then
  963. -          eval flag=\"$hardcode_libdir_flag_spec\"
  964. -
  965. -          finalize_command="$finalize_command $flag"
  966. -        fi
  967. -      elif test -n "$runpath_var"; then
  968. -        case "$perm_rpath " in
  969. -        *" $libdir "*) ;;
  970. -        *) perm_rpath="$perm_rpath $libdir" ;;
  971. -        esac
  972. -        case "$finalize_perm_rpath " in
  973. -        *" $libdir "*) ;;
  974. -        *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  975. -        esac
  976. +        rpath="$rpath $flag"
  977.        fi
  978. -    done
  979. -      fi
  980. -
  981. -      # Substitute the hardcoded libdirs into the compile commands.
  982. -      if test -n "$hardcode_libdir_separator"; then
  983. -    compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
  984. -    finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$finalize_hardcode_libdirs%g"`
  985. +    elif test -n "$runpath_var"; then
  986. +      case "$finalize_perm_rpath " in
  987. +      *" $libdir "*) ;;
  988. +      *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  989. +      esac
  990. +    fi
  991. +      done
  992. +      # Substitute the hardcoded libdirs into the rpath.
  993. +      if test -n "$hardcode_libdir_separator" &&
  994. +     test -n "$hardcode_libdirs"; then
  995. +    libdir="$hardcode_libdirs"
  996. +    eval rpath=\" $hardcode_libdir_flag_spec\"
  997.        fi
  998. +      finalize_rpath="$rpath"
  999.  
  1000.        output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1001.        if test "X$output_objdir" = "X$output"; then
  1002. @@ -2076,27 +2275,25 @@
  1003.      finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1004.        fi
  1005.  
  1006. -      if test "$export_dynamic" = yes || test -n "$dlfiles$dlprefiles" && test -n "$NM" && test -n "$global_symbol_pipe"; then
  1007. -    dlsyms="${outputname}S.c"
  1008. -      else
  1009. -    dlsyms=
  1010. +      dlsyms=
  1011. +      if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then
  1012. +    if test -n "$NM" && test -n "$global_symbol_pipe"; then
  1013. +      dlsyms="${outputname}S.c"
  1014. +    else
  1015. +      $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  1016. +    fi
  1017.        fi
  1018.  
  1019.        if test -n "$dlsyms"; then
  1020.      case "$dlsyms" in
  1021.      "") ;;
  1022.      *.c)
  1023. -      if test "$export_dynamic" = yes && test -z "$export_symbols"; then
  1024. -        # Add our own program objects to the preloaded list.
  1025. -        dlprefiles=`$echo "X$objs $dlprefiles" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1026. -      fi
  1027. -
  1028.        # Discover the nlist of each of the dlfiles.
  1029.        nlist="$objdir/${output}.nm"
  1030.  
  1031.        if test -d $objdir; then
  1032. -        $show "$rm $nlist ${nlist}T"
  1033. -        $run $rm "$nlist" "${nlist}T"
  1034. +        $show "$rm $nlist ${nlist}S ${nlist}T"
  1035. +        $run $rm "$nlist" "${nlist}S" "${nlist}T"
  1036.        else
  1037.          $show "$mkdir $objdir"
  1038.          $run $mkdir $objdir
  1039. @@ -2123,12 +2320,45 @@
  1040.  /* External symbol declarations for the compiler. */\
  1041.  "
  1042.  
  1043. -      if test "$export_dynamic" = yes && test -n "$export_symbols"; then
  1044. -        sed -e 's/^\(.*\)/\1 \1/' < "$export_symbols" > "$nlist"
  1045. +      if test "$dlself" = yes; then
  1046. +        $show "generating symbol list for \`$output'"
  1047. +
  1048. +        echo ': @PROGRAM@ ' > "$nlist"
  1049. +
  1050. +        # Add our own program objects to the symbol list.
  1051. +        progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1052. +        for arg in $progfiles; do
  1053. +          $show "extracting global C symbols from \`$arg'"
  1054. +          $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  1055. +        done
  1056. +
  1057. +        if test -n "$exclude_expsyms"; then
  1058. +          $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  1059. +          $run eval '$mv "$nlist"T "$nlist"'
  1060. +        fi
  1061. +        
  1062. +        if test -n "$export_symbols_regex"; then
  1063. +          $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  1064. +          $run eval '$mv "$nlist"T "$nlist"'
  1065. +        fi
  1066. +
  1067. +        # Prepare the list of exported symbols
  1068. +        if test -z "$export_symbols"; then
  1069. +          export_symbols="$objdir/$output.exp"
  1070. +          $run $rm $export_symbols
  1071. +          $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  1072. +        else
  1073. +          $run $rm $export_symbols
  1074. +          $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$objdir/$output.exp"'
  1075. +          $run eval 'grep -f "$objdir/$output.exp" < "$nlist" > "$nlist"T'
  1076. +          $run eval 'mv "$nlist"T "$nlist"'
  1077. +        fi
  1078.        fi
  1079.  
  1080.        for arg in $dlprefiles; do
  1081.          $show "extracting global C symbols from \`$arg'"
  1082. +        name=`echo "$arg" | sed -e 's%^.*/%%'`
  1083. +        $run eval 'echo ": $name " >> "$nlist"'
  1084.          $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  1085.        done
  1086.  
  1087. @@ -2136,15 +2366,20 @@
  1088.          # Make sure we have at least an empty file.
  1089.          test -f "$nlist" || : > "$nlist"
  1090.  
  1091. +        if test -n "$exclude_expsyms"; then
  1092. +          egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  1093. +          $mv "$nlist"T "$nlist"
  1094. +        fi
  1095. +
  1096.          # Try sorting and uniquifying the output.
  1097. -        if sort "$nlist" | uniq > "$nlist"T; then
  1098. -          mv -f "$nlist"T "$nlist"
  1099. +        if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
  1100. +          :
  1101.          else
  1102. -          $rm "$nlist"T
  1103. +          grep -v "^: " < "$nlist" > "$nlist"S
  1104.          fi
  1105.  
  1106. -        if test -f "$nlist"; then
  1107. -          sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$output_objdir/$dlsyms"
  1108. +        if test -f "$nlist"S; then
  1109. +          eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  1110.          else
  1111.            echo '/* NONE */' >> "$output_objdir/$dlsyms"
  1112.          fi
  1113. @@ -2169,33 +2404,20 @@
  1114.  {\
  1115.  "
  1116.  
  1117. -        if test "$export_dynamic" = yes && test -n "$export_symbols"; then
  1118. -          echo >> "$output_objdir/$dlsyms" "\
  1119. -  {\"${output}\", (lt_ptr_t) 0},"
  1120. -          sed 's/^\(.*\)/  {"\1", (lt_ptr_t) \&\1},/' < "$export_symbols" >> "$output_objdir/$dlsyms"
  1121. -        fi
  1122. -
  1123. -        for arg in $dlprefiles; do
  1124. -          name=`echo "$arg" | sed -e 's%^.*/%%'`
  1125. -          echo >> "$output_objdir/$dlsyms" "\
  1126. -  {\"$name\", (lt_ptr_t) 0},"
  1127. -          eval "$NM $arg | $global_symbol_pipe > '$nlist'"
  1128. -
  1129. -          if test -f "$nlist"; then
  1130. -        sed 's/^\(.*\) \(.*\)$/  {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms"
  1131. -          else
  1132. -        echo '/* NONE */' >> "$output_objdir/$dlsyms"
  1133. -          fi
  1134. -        done
  1135. +        sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
  1136. +        -e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
  1137. +          < "$nlist" >> "$output_objdir/$dlsyms"
  1138.  
  1139.          $echo >> "$output_objdir/$dlsyms" "\
  1140.    {0, (lt_ptr_t) 0}
  1141.  };
  1142.  
  1143.  /* This works around a problem in FreeBSD linker */
  1144. +#ifdef FREEBSD_WORKAROUND
  1145.  static const void *lt_preloaded_setup() {
  1146.    return lt_preloaded_symbols;
  1147.  }
  1148. +#endif
  1149.  
  1150.  #ifdef __cplusplus
  1151.  }
  1152. @@ -2203,10 +2425,23 @@
  1153.  "
  1154.        fi
  1155.  
  1156. +      pic_flag_for_symtable=
  1157. +          case "$host" in
  1158. +      # compiling the symbol table file with pic_flag works around
  1159. +      # a FreeBSD bug that causes programs to crash when -lm is
  1160. +      # linked before any other PIC object.  But we must not use
  1161. +      # pic_flag when linking with -static.  The problem exists in
  1162. +      # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  1163. +      *-*-freebsd2*|*-*-freebsd3.0*)
  1164. +        case "$compile_command " in
  1165. +        *" -static "*) ;;
  1166. +        *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
  1167. +        esac
  1168. +      esac
  1169. +
  1170.        # Now compile the dynamic symbol file.
  1171. -      # pic_flag works around a bug in FreeBSD linker
  1172. -      $show "(cd $objdir && $C_compiler -c$no_builtin_flag $pic_flag -DPIC \"$dlsyms\")"
  1173. -      $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag $pic_flag -DPIC "$dlsyms")' || exit $?
  1174. +      $show "(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  1175. +      $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  1176.  
  1177.        # Transform the symbol file into the correct name.
  1178.        compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
  1179. @@ -2221,9 +2456,6 @@
  1180.      # We keep going just in case the user didn't refer to
  1181.      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
  1182.      # really was required.
  1183. -    if test -n "$dlfiles$dlprefiles"; then
  1184. -      $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  1185. -    fi
  1186.  
  1187.      # Nullify the symbol file.
  1188.      compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  1189. @@ -2233,28 +2465,14 @@
  1190.        if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
  1191.      # Replace the output file specification.
  1192.      compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  1193. -    finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  1194. +    link_command="$compile_command$compile_rpath"
  1195.  
  1196.      # We have no uninstalled library dependencies, so finalize right now.
  1197. -    $show "$compile_command"
  1198. -    $run eval "$compile_command"
  1199. +    $show "$link_command"
  1200. +    $run eval "$link_command"
  1201.      exit $?
  1202.        fi
  1203.  
  1204. -      # Replace the output file specification.
  1205. -      compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  1206. -      finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'T%g'`
  1207. -
  1208. -      # Create the binary in the object directory, then wrap it.
  1209. -      if test ! -d $output_objdir; then
  1210. -    $show "$mkdir $output_objdir"
  1211. -    $run $mkdir $output_objdir
  1212. -    status=$?
  1213. -    if test $status -ne 0 && test ! -d $objdir; then
  1214. -      exit $status
  1215. -    fi
  1216. -      fi
  1217. -
  1218.        if test -n "$shlibpath_var"; then
  1219.      # We should set the shlibpath_var
  1220.      rpath=
  1221. @@ -2273,49 +2491,83 @@
  1222.      temp_rpath="$rpath"
  1223.        fi
  1224.  
  1225. -      # Delete the old output file.
  1226. -      $run $rm $output
  1227. -
  1228. -      if test -n "$compile_shlibpath"; then
  1229. -    compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
  1230. +      if test -n "$compile_shlibpath$finalize_shlibpath"; then
  1231. +    compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  1232.        fi
  1233.        if test -n "$finalize_shlibpath"; then
  1234.      finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  1235.        fi
  1236.  
  1237. +      compile_var=
  1238. +      finalize_var=
  1239.        if test -n "$runpath_var"; then
  1240. -        if test -n "$perm_rpath"; then
  1241. +    if test -n "$perm_rpath"; then
  1242.        # We should set the runpath_var.
  1243.        rpath=
  1244.        for dir in $perm_rpath; do
  1245.          rpath="$rpath$dir:"
  1246.        done
  1247. -      compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
  1248. +      compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  1249.      fi
  1250. -        if test -n "$finalize_perm_rpath"; then
  1251. +    if test -n "$finalize_perm_rpath"; then
  1252.        # We should set the runpath_var.
  1253.        rpath=
  1254.        for dir in $finalize_perm_rpath; do
  1255.          rpath="$rpath$dir:"
  1256.        done
  1257. -      finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
  1258. +      finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  1259.      fi
  1260.        fi
  1261.  
  1262.        if test "$hardcode_action" = relink; then
  1263. +    # Fast installation is not supported
  1264. +    link_command="$compile_var$compile_command$compile_rpath"
  1265. +    relink_command="$finalize_var$finalize_command$finalize_rpath"
  1266. +    
  1267.      # AGH! Flame the AIX and HP-UX people for me, will ya?
  1268.      $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  1269.      $echo "$modename: \`$output' will be relinked during installation" 1>&2
  1270. +      else
  1271. +    if test "$fast_install" != no; then
  1272. +      link_command="$finalize_var$compile_command$finalize_rpath"
  1273. +      if test "$fast_install" = yes; then
  1274. +        relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  1275. +      else
  1276. +        # fast_install is set to needless
  1277. +        relink_command=
  1278. +      fi
  1279. +    else
  1280. +      link_command="$compile_var$compile_command$compile_rpath"
  1281. +      relink_command="$finalize_var$finalize_command$finalize_rpath"
  1282. +    fi
  1283. +      fi
  1284. +
  1285. +      # Replace the output file specification.
  1286. +      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  1287. +      
  1288. +      # Create the binary in the object directory, then wrap it.
  1289. +      if test ! -d $output_objdir; then
  1290. +    $show "$mkdir $output_objdir"
  1291. +    $run $mkdir $output_objdir
  1292. +    status=$?
  1293. +    if test $status -ne 0 && test ! -d $objdir; then
  1294. +      exit $status
  1295. +    fi
  1296.        fi
  1297.  
  1298. -      $show "$compile_command"
  1299. -      $run eval "$compile_command" || exit $?
  1300. +      # Delete the old output file.
  1301. +      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  1302. +
  1303. +      $show "$link_command"
  1304. +      $run eval "$link_command" || exit $?
  1305.  
  1306.        # Now create the wrapper script.
  1307.        $show "creating $output"
  1308.  
  1309. -      # Quote the finalize command for shipping.
  1310. -      finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
  1311. +      # Quote the relink command for shipping.
  1312. +      if test -n "$relink_command"; then
  1313. +    relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  1314. +      fi
  1315.  
  1316.        # Quote $echo for shipping.
  1317.        if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
  1318. @@ -2359,11 +2611,12 @@
  1319.  # if CDPATH is set.
  1320.  if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
  1321.  
  1322. +relink_command=\"$relink_command\"
  1323. +
  1324.  # This environment variable determines our operation mode.
  1325.  if test \"\$libtool_install_magic\" = \"$magic\"; then
  1326. -  # install mode needs the following variables:
  1327. +  # install mode needs the following variable:
  1328.    link_against_libtool_libs='$link_against_libtool_libs'
  1329. -  finalize_command=\"cd `pwd | sed -e $sed_quote_subst`; $finalize_command\"
  1330.  else
  1331.    # When we are sourced in execute mode, \$file and \$echo are already set.
  1332.    if test \"\$libtool_execute_magic\" != \"$magic\"; then
  1333. @@ -2408,14 +2661,54 @@
  1334.    # Try to get the absolute directory name.
  1335.    absdir=\`cd \"\$thisdir\" && pwd\`
  1336.    test -n \"\$absdir\" && thisdir=\"\$absdir\"
  1337. +"
  1338.  
  1339. +    if test "$fast_install" = yes; then
  1340. +      echo >> $output "\
  1341. +  program=lt-'$outputname'
  1342.    progdir=\"\$thisdir/$objdir\"
  1343. +  
  1344. +  if test ! -f \"\$progdir/\$program\" || \\
  1345. +     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
  1346. +       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  1347. +
  1348. +    file=\"\$\$-\$program\"
  1349. +
  1350. +    if test ! -d \"\$progdir\"; then
  1351. +      $mkdir \"\$progdir\"
  1352. +    else
  1353. +      $rm \"\$progdir/\$file\"
  1354. +    fi"
  1355. +
  1356. +      echo >> $output "\
  1357. +
  1358. +    # relink executable if necessary
  1359. +    if test -n \"\$relink_command\"; then
  1360. +      if (cd \"\$thisdir\" && eval \$relink_command); then :
  1361. +      else
  1362. +    $rm \"\$progdir/\$file\"
  1363. +    exit 1
  1364. +      fi
  1365. +    fi
  1366. +
  1367. +    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  1368. +    { $rm \"\$progdir/\$program\";
  1369. +      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  1370. +    $rm \"\$progdir/\$file\"
  1371. +  fi"
  1372. +    else
  1373. +      echo >> $output "\
  1374.    program='$outputname'
  1375. +  progdir=\"\$thisdir/$objdir\"
  1376. +"
  1377. +    fi
  1378. +
  1379. +    echo >> $output "\
  1380.  
  1381.    if test -f \"\$progdir/\$program\"; then"
  1382.  
  1383.      # Export our shlibpath_var if we have one.
  1384. -    if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  1385. +    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  1386.        $echo >> $output "\
  1387.      # Add our own library path to $shlibpath_var
  1388.      $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  1389. @@ -2441,7 +2734,7 @@
  1390.        # Run the actual program with our arguments.
  1391.  "
  1392.      case $host in
  1393. -    *-*-cygwin32* | *-*-mingw32 | *-*-os2*)
  1394. +    *-*-cygwin* | *-*-mingw | *-*-os2*)
  1395.        # win32 systems need to use the prog path for dll
  1396.        # lookup to work
  1397.        $echo >> $output "\
  1398. @@ -2499,7 +2792,7 @@
  1399.      # Extract the objects.
  1400.      xdir="$xlib"x
  1401.      generated="$generated $xdir"
  1402. -    xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
  1403. +    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  1404.  
  1405.      $show "${rm}r $xdir"
  1406.      $run ${rm}r "$xdir"
  1407. @@ -2579,6 +2872,10 @@
  1408.  # Directory that this library needs to be installed in:
  1409.  libdir='$install_libdir'\
  1410.  "
  1411. +
  1412. +    $rm "$output_objdir/$outputname"i
  1413. +    sed 's/^installed=no$/installed=yes/' \
  1414. +      < "$output" > "$output_objdir/$outputname"i || exit 1
  1415.        fi
  1416.  
  1417.        # Do a symbolic link so that the libtool archive can be found in
  1418. @@ -2826,13 +3123,14 @@
  1419.      # Install the pseudo-library for information purposes.
  1420.      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  1421.      instname="$dir/$name"i
  1422. -    $show "Creating $instname"
  1423. -    $rm "$instname"
  1424. -    sed 's/^installed=no$/installed=yes/' "$file" > "$instname"
  1425. +    if test ! -f "$instname"; then
  1426. +      # Just in case it was removed...
  1427. +      $show "Creating $instname"
  1428. +      $rm "$instname"
  1429. +      sed 's/^installed=no$/installed=yes/' "$file" > "$instname"
  1430. +    fi
  1431.      $show "$install_prog $instname $destdir/$name"
  1432.      $run eval "$install_prog $instname $destdir/$name" || exit $?
  1433. -    $show "$rm $instname"
  1434. -    $rm "$instname"
  1435.  
  1436.      # Maybe install the static library, too.
  1437.      test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  1438. @@ -2894,7 +3192,7 @@
  1439.      # Do a test to see if this is really a libtool program.
  1440.      if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1441.        link_against_libtool_libs=
  1442. -      finalize_command=
  1443. +      relink_command=
  1444.  
  1445.        # If there is no directory component, then add one.
  1446.        case "$file" in
  1447. @@ -2903,7 +3201,7 @@
  1448.        esac
  1449.  
  1450.        # Check the variables that should have been set.
  1451. -      if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
  1452. +      if test -z "$link_against_libtool_libs"; then
  1453.          $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
  1454.          exit 1
  1455.        fi
  1456. @@ -2926,16 +3224,21 @@
  1457.          fi
  1458.        done
  1459.  
  1460. -      if test "$hardcode_action" = relink; then
  1461. +      outputname=
  1462. +      if test "$fast_install" = no && test -n "$relink_command"; then
  1463.          if test "$finalize" = yes; then
  1464. +          outputname="/tmp/$$-$file"
  1465. +          # Replace the output file specification.
  1466. +          relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  1467. +
  1468.            $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
  1469. -          $show "$finalize_command"
  1470. -          if $run eval "$finalize_command"; then :
  1471. +          $show "$relink_command"
  1472. +          if $run eval "$relink_command"; then :
  1473.            else
  1474.          $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  1475.          continue
  1476.            fi
  1477. -          file="$objdir/$file"T
  1478. +          file="$outputname"
  1479.          else
  1480.            $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
  1481.          fi
  1482. @@ -2947,6 +3250,7 @@
  1483.  
  1484.      $show "$install_prog$stripme $file $destfile"
  1485.      $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  1486. +    test -n "$outputname" && $rm $outputname
  1487.      ;;
  1488.        esac
  1489.      done
  1490. --- ./ltconfig    Wed Feb 24 10:46:26 1999
  1491. +++ ../imlib-1.9.4/./ltconfig    Wed Apr 14 16:12:44 1999
  1492. @@ -153,14 +153,18 @@
  1493.  # Same as above, but do not quote variable references.
  1494.  double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
  1495.  
  1496. +# Sed substitution to delay expansion of an escaped shell variable in a
  1497. +# double_quote_subst'ed string.
  1498. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  1499. +
  1500.  # The name of this program.
  1501.  progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
  1502.  
  1503.  # Constants:
  1504.  PROGRAM=ltconfig
  1505.  PACKAGE=libtool
  1506. -VERSION=1.2e
  1507. -TIMESTAMP=" (1.255 1999/01/28 13:33:31)"
  1508. +VERSION=1.2f
  1509. +TIMESTAMP=" (1.385 1999/03/15 17:24:54)"
  1510.  ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
  1511.  ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
  1512.  rm="rm -f"
  1513. @@ -173,6 +177,8 @@
  1514.  enable_shared=yes
  1515.  # All known linkers require a `.a' archive for static linking.
  1516.  enable_static=yes
  1517. +enable_fast_install=yes
  1518. +enable_dlopen=unknown
  1519.  ltmain=
  1520.  silent=
  1521.  srcdir=
  1522. @@ -185,8 +191,10 @@
  1523.  with_gcc=no
  1524.  with_gnu_ld=no
  1525.  need_locks=yes
  1526. +ac_ext=c
  1527.  objext=o
  1528.  libext=a
  1529. +cache_file=
  1530.  
  1531.  old_AR="$AR"
  1532.  old_CC="$CC"
  1533. @@ -225,6 +233,9 @@
  1534.      --debug                enable verbose shell tracing
  1535.      --disable-shared       do not build shared libraries
  1536.      --disable-static       do not build static libraries
  1537. +    --disable-fast-install do not optimize for fast installation
  1538. +    --enable-dlopen        enable dlopen support
  1539. +    --enable-dlopen-self   enable support for dlopening programs
  1540.      --help                 display this help and exit
  1541.      --no-verify            do not verify that HOST is a valid host type
  1542.  -o, --output=FILE          specify the output file [default=$default_ofile]
  1543. @@ -235,6 +246,7 @@
  1544.      --with-gcc             assume that the GNU C compiler will be used
  1545.      --with-gnu-ld          assume that the C compiler uses the GNU linker
  1546.      --disable-lock         disable file locking
  1547. +    --cache-file=FILE      configure cache file
  1548.  
  1549.  LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
  1550.  that provides basic libtool functionality.
  1551. @@ -253,6 +265,10 @@
  1552.  
  1553.    --disable-static) enable_static=no ;;
  1554.  
  1555. +  --disable-fast-install) enable_fast_install=no ;;
  1556. +
  1557. +  --enable-dlopen) enable_dlopen=yes ;;
  1558. +
  1559.    --quiet | --silent) silent=yes ;;
  1560.  
  1561.    --srcdir) prev=srcdir ;;
  1562. @@ -270,6 +286,8 @@
  1563.  
  1564.    --disable-lock) need_locks=no ;;
  1565.  
  1566. +  --cache-file=*) cache_file="$optarg" ;;
  1567. +
  1568.    -*)
  1569.      echo "$progname: unrecognized option \`$option'" 1>&2
  1570.      echo "$help" 1>&2
  1571. @@ -340,6 +358,11 @@
  1572.  if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  1573.  if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  1574.  
  1575. +if test -n "$cache_file" && test -r "$cache_file"; then
  1576. +  echo "loading cache $cache_file within ltconfig"
  1577. +  . $cache_file
  1578. +fi
  1579. +
  1580.  if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  1581.    # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  1582.    if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  1583. @@ -354,7 +377,7 @@
  1584.  
  1585.  if test -z "$srcdir"; then
  1586.    # Assume the source directory is the same one as the path to LTMAIN.
  1587. -  srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  1588. +  srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  1589.    test "$srcdir" = "$ltmain" && srcdir=.
  1590.  fi
  1591.  
  1592. @@ -464,7 +487,7 @@
  1593.    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
  1594.  fi
  1595.  
  1596. -# Set sane defaults for `DLLTOOL' and `AS', used on cygwin32.
  1597. +# Set sane defaults for `DLLTOOL' and `AS', used on cygwin.
  1598.  test -z "$DLLTOOL" && DLLTOOL=dlltool
  1599.  test -z "$AS" && AS=as
  1600.  
  1601. @@ -538,7 +561,7 @@
  1602.    # Now see if the compiler is really GCC.
  1603.    with_gcc=no
  1604.    echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
  1605. -  echo "$progname:541: checking whether we are using GNU C" >&5
  1606. +  echo "$progname:564: checking whether we are using GNU C" >&5
  1607.  
  1608.    $rm conftest.c
  1609.    cat > conftest.c <<EOF
  1610. @@ -546,7 +569,7 @@
  1611.    yes;
  1612.  #endif
  1613.  EOF
  1614. -  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  1615. +  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  1616.      with_gcc=yes
  1617.    fi
  1618.    $rm conftest.c
  1619. @@ -560,8 +583,8 @@
  1620.  echo $ac_n "checking for object suffix... $ac_c" 1>&6
  1621.  $rm conftest*
  1622.  echo 'int i = 1;' > conftest.c
  1623. -echo "$progname:563: checking for object suffix" >& 5
  1624. -if { (eval echo $progname:564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
  1625. +echo "$progname:586: checking for object suffix" >& 5
  1626. +if { (eval echo $progname:587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
  1627.    # Append any warnings to the config.log.
  1628.    cat conftest.err 1>&5
  1629.  
  1630. @@ -603,7 +626,7 @@
  1631.      # we not sure about C++ programs.
  1632.      link_static_flag="$link_static_flag ${wl}-lC"
  1633.      ;;
  1634. -  cygwin32* | mingw32* | os2*)
  1635. +  cygwin* | mingw* | os2*)
  1636.      # We can build DLLs from non-PIC.
  1637.      ;;
  1638.    amigaos*)
  1639. @@ -637,7 +660,7 @@
  1640.      # PIC (with -KPIC) is the default.
  1641.      ;;
  1642.  
  1643. -  cygwin32* | mingw32* | os2*)
  1644. +  cygwin* | mingw* | os2*)
  1645.      # We can build DLLs from non-PIC.
  1646.      ;;
  1647.  
  1648. @@ -691,8 +714,8 @@
  1649.    echo "int some_variable = 0;" > conftest.c
  1650.    save_CFLAGS="$CFLAGS"
  1651.    CFLAGS="$CFLAGS $pic_flag -DPIC"
  1652. -  echo "$progname:694: checking if $compiler PIC flag $pic_flag works" >&5
  1653. -  if { (eval echo $progname:695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
  1654. +  echo "$progname:717: checking if $compiler PIC flag $pic_flag works" >&5
  1655. +  if { (eval echo $progname:718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
  1656.      # Append any warnings to the config.log.
  1657.      cat conftest.err 1>&5
  1658.      
  1659. @@ -734,8 +757,8 @@
  1660.  echo "int some_variable = 0;" > conftest.c
  1661.  save_CFLAGS="$CFLAGS"
  1662.  CFLAGS="$CFLAGS -c -o conftest2.o"
  1663. -echo "$progname:737: checking if $compiler supports -c -o file.o" >&5
  1664. -if { (eval echo $progname:738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then
  1665. +echo "$progname:760: checking if $compiler supports -c -o file.o" >&5
  1666. +if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then
  1667.  
  1668.    # The compiler can only warn and ignore the option if not recognized
  1669.    # So say no if there are warnings
  1670. @@ -762,8 +785,8 @@
  1671.    echo "int some_variable = 0;" > conftest.c
  1672.    save_CFLAGS="$CFLAGS"
  1673.    CFLAGS="$CFLAGS -c -o conftest.lo"
  1674. -  echo "$progname:765: checking if $compiler supports -c -o file.lo" >&5
  1675. -if { (eval echo $progname:766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
  1676. +  echo "$progname:788: checking if $compiler supports -c -o file.lo" >&5
  1677. +if { (eval echo $progname:789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
  1678.  
  1679.      # The compiler can only warn and ignore the option if not recognized
  1680.      # So say no if there are warnings
  1681. @@ -814,8 +837,8 @@
  1682.    echo "int some_variable = 0;" > conftest.c
  1683.    save_CFLAGS="$CFLAGS"
  1684.    CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
  1685. -  echo "$progname:817: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  1686. -  if { (eval echo $progname:818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  1687. +  echo "$progname:840: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  1688. +  if { (eval echo $progname:841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  1689.  
  1690.      # The compiler can only warn and ignore the option if not recognized
  1691.      # So say no if there are warnings
  1692. @@ -858,8 +881,8 @@
  1693.  echo 'main(){return(0);}' > conftest.c
  1694.  save_LDFLAGS="$LDFLAGS"
  1695.  LDFLAGS="$LDFLAGS $link_static_flag"
  1696. -echo "$progname:861: checking if $compiler static flag $link_static_flag works" >&5
  1697. -if { (eval echo $progname:862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  1698. +echo "$progname:884: checking if $compiler static flag $link_static_flag works" >&5
  1699. +if { (eval echo $progname:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  1700.    echo "$ac_t$link_static_flag" 1>&6
  1701.  else
  1702.    echo "$ac_t"none 1>&6
  1703. @@ -891,48 +914,18 @@
  1704.    if test "$with_gcc" = yes; then
  1705.      # Check if gcc -print-prog-name=ld gives a path.
  1706.      echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
  1707. -    echo "$progname:894: checking for ld used by GCC" >&5
  1708. +    echo "$progname:917: checking for ld used by GCC" >&5
  1709.      ac_prog=`($CC -print-prog-name=ld) 2>&5`
  1710.      case "$ac_prog" in
  1711.      # Accept absolute paths.
  1712. -    /* | [A-Za-z]:/*)
  1713. +    /* | [A-Za-z]:[\\/]*)
  1714.        re_direlt='/[^/][^/]*/\.\./'
  1715. -      sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%'
  1716.        # Canonicalize the path of ld
  1717. +      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  1718.        while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  1719.      ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  1720.        done
  1721. -      case "$host_os" in
  1722. -      cygwin*)
  1723. -    # Convert to a UNC path for cygwin
  1724. -    test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive"`
  1725. -    ;;
  1726. -      *)
  1727. -    test -z "$LD" && LD="$ac_prog"
  1728. -    ;;
  1729. -      esac
  1730. -      ;;
  1731. -    ##
  1732. -    ## FIXME:  The code fails later on if we try to use an $LD with
  1733. -    ##         '\\' path separators.
  1734. -    ##
  1735. -    [A-Za-z]:[\\]*)
  1736. -      re_direlt='\\[^\\][^\\]*\\\.\.\(\\\)'
  1737. -      sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%'
  1738. -      sub_uncdir='s%\\%/%g'
  1739. -      # Canonicalize the path of ld
  1740. -      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  1741. -    ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%"`
  1742. -      done
  1743. -      case "$host_os" in
  1744. -      cygwin*)
  1745. -    # Convert to a UNC path for cygwin
  1746. -    test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive" -e "$sub_uncdir"`
  1747. -    ;;
  1748. -      *)
  1749. -    test -z "$LD" && LD="$ac_prog"
  1750. -    ;;
  1751. -      esac
  1752. +      test -z "$LD" && LD="$ac_prog"
  1753.        ;;
  1754.      "")
  1755.        # If it fails, then pretend we are not using GCC.
  1756. @@ -945,10 +938,10 @@
  1757.      esac
  1758.    elif test "$with_gnu_ld" = yes; then
  1759.      echo $ac_n "checking for GNU ld... $ac_c" 1>&6
  1760. -    echo "$progname:948: checking for GNU ld" >&5
  1761. +    echo "$progname:941: checking for GNU ld" >&5
  1762.    else
  1763.      echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
  1764. -    echo "$progname:951: checking for non-GNU ld" >&5
  1765. +    echo "$progname:944: checking for non-GNU ld" >&5
  1766.    fi
  1767.  
  1768.    if test -z "$LD"; then
  1769. @@ -999,8 +992,10 @@
  1770.  no_undefined_flag=
  1771.  need_lib_prefix=unknown
  1772.  need_version=unknown
  1773. +# when you set need_version to no, make sure it does not cause -set_version
  1774. +# flags to be left without arguments
  1775.  archive_cmds=
  1776. -archive_sym_cmds=
  1777. +archive_expsym_cmds=
  1778.  old_archive_from_new_cmds=
  1779.  export_dynamic_flag_spec=
  1780.  whole_archive_flag_spec=
  1781. @@ -1011,12 +1006,31 @@
  1782.  hardcode_minus_L=no
  1783.  hardcode_shlibpath_var=unsupported
  1784.  runpath_var=
  1785. +always_export_symbols=no
  1786. +export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  1787. +# include_expsyms should be a list of space-separated symbols to be *always*
  1788. +# included in the symbol list
  1789. +include_expsyms=
  1790. +# exclude_expsyms can be an egrep regular expression of symbols to exclude
  1791. +# it will be wrapped by ` (' and `)$', so one must not match beginning or
  1792. +# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  1793. +# as well as any symbol that contains `d'.
  1794. +exclude_expsyms=
  1795.  
  1796.  case "$host_os" in
  1797. -aix3* | aix4*)
  1798. -  # On AIX, the GNU linker works like the native linker.
  1799. -  with_gnu_ld=no
  1800. +cygwin* | mingw*)
  1801. +  # FIXME: the MSVC++ port hasn't been tested in a loooong time
  1802. +  # When not using gcc, we currently assume that we are using
  1803. +  # Microsoft Visual C++.
  1804. +  if test "$with_gcc" != yes; then
  1805. +    with_gnu_ld=no
  1806. +  fi
  1807.    ;;
  1808. +
  1809. +freebsd2* | sunos4*)
  1810. +  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  1811. +  ;;
  1812. +
  1813.  esac
  1814.  
  1815.  ld_shlibs=yes
  1816. @@ -1026,6 +1040,20 @@
  1817.  
  1818.    # See if GNU ld supports shared libraries.
  1819.    case "$host_os" in
  1820. +  aix3* | aix4*)
  1821. +    # On AIX, the GNU linker is very broken
  1822. +    ld_shlibs=no
  1823. +    cat <<EOF 1>&2
  1824. +
  1825. +*** Warning: the GNU linker, at least up to release 2.9.1, is reported
  1826. +*** to be unable to reliably create shared libraries on AIX.
  1827. +*** Therefore, libtool is disabling shared libraries support.  If you
  1828. +*** really care for shared libraries, you may want to modify your PATH
  1829. +*** so that a non-GNU linker is found, and then restart.
  1830. +
  1831. +EOF
  1832. +    ;;
  1833. +
  1834.    amigaos*)
  1835.      archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  1836.      hardcode_libdir_flag_spec='-L$libdir'
  1837. @@ -1042,67 +1070,47 @@
  1838.  
  1839.    beos*)
  1840.      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  1841. -      archive_cmds='$CC -nostart ${wl}-soname $wl$soname -o $lib $libobjs $deplibs $linkopts'
  1842. +      archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1843.      else
  1844.        ld_shlibs=no
  1845.      fi
  1846.      ;;
  1847.  
  1848. -  cygwin32* | mingw32*)
  1849. -    if test "$with_gcc" = yes; then
  1850. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  1851. -      # no search path for DLLs.
  1852. -      hardcode_libdir_flag_spec='-L$libdir'
  1853. -      allow_undefined_flag=unsupported
  1854. -      # Very, very bogus.
  1855. +  cygwin* | mingw*)
  1856. +    # hardcode_libdir_flag_spec is actually meaningless, as there is
  1857. +    # no search path for DLLs.
  1858. +    hardcode_libdir_flag_spec='-L$libdir'
  1859. +    allow_undefined_flag=unsupported
  1860. +    always_export_symbols=yes
  1861.  
  1862. -      archive_cmds='rm -f $objdir/$soname-ltdll.c~
  1863. +    # Extract the symbol export list from an `--export-all' def file,
  1864. +    # then regenerate the def file from the symbol export list, so that
  1865. +    # the compiled dll only exports the symbol export list.
  1866. +    export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~
  1867.        sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  1868.        (cd $objdir && $CC -c $soname-ltdll.c)~
  1869. -      echo EXPORTS > $objdir/$soname-def~
  1870. -      $DLLTOOL --export-all --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
  1871. -      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1872. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1873. -      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1874. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1875. -      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
  1876. +      $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def  $objdir/$soname-ltdll.$objext $libobjs~
  1877. +      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
  1878.  
  1879. -      archive_sym_cmds='rm -f $objdir/$soname-ltdll.c~
  1880. -      sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  1881. -      (cd $objdir && $CC -c $soname-ltdll.c)~
  1882. -      echo EXPORTS > $objdir/$soname-def~
  1883. -      cat "$export_symbols" >> $objdir/$soname-def~
  1884. +    archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
  1885. +      _lt_hint=1;
  1886. +      for symbol in `cat $export_symbols`; do
  1887. +        echo "    \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
  1888. +    _lt_hint=`expr 1 + \$_lt_hint`;
  1889. +      done~
  1890.        $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1891. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1892. +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1893.        $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1894. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1895. +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1896.        $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
  1897.  
  1898.        old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
  1899. -   else
  1900. -      # When not using gcc, we currently assume that we are using
  1901. -      # Microsoft Visual C++.
  1902. -      with_gnu_ld=no
  1903. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  1904. -      # no search path for DLLs.
  1905. -      hardcode_libdir_flag_spec=' '
  1906. -      allow_undefined_flag=unsupported
  1907. -      # Tell ltmain to make .lib files, not .a files.
  1908. -      libext=lib
  1909. -      # FIXME: Setting linknames here is a bad hack.
  1910. -      archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  1911. -      # The linker will automatically build a .lib file if we build a DLL.
  1912. -      old_archive_from_new_cmds='true'
  1913. -      # FIXME: Should let the user specify the lib program.
  1914. -      old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  1915. -      fix_srcfile_path='`cygpath -w $srcfile`'
  1916. -    fi
  1917.      ;;
  1918.  
  1919.    *)
  1920.      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  1921. -      archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib $libobjs $deplibs $linkopts'
  1922. -      archive_sym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib $libobjs $deplibs $linkopts'
  1923. +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  1924. +      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1925.      else
  1926.        ld_shlibs=no
  1927.      fi
  1928. @@ -1120,9 +1128,8 @@
  1929.    case "$host_os" in
  1930.    aix3*)
  1931.      allow_undefined_flag=unsupported
  1932. -    archive_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
  1933. -    $LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  1934. -    archive_sym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  1935. +    always_export_symbols=yes
  1936. +    archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  1937.      # Note: this linker hardcodes the directories in LIBPATH if there
  1938.      # are no directories specified by -L.
  1939.      hardcode_minus_L=yes
  1940. @@ -1137,19 +1144,18 @@
  1941.      allow_undefined_flag=
  1942.      if test "$with_gcc" = yes; then
  1943.        if strings `${CC} -print-prog-name=collect2` | \
  1944. -         grep resolve_lib_name >/dev/null
  1945. +     grep resolve_lib_name >/dev/null
  1946.        then
  1947. -        # We have reworked collect2
  1948. -        hardcode_direct=yes
  1949. +    # We have reworked collect2
  1950. +    hardcode_direct=yes
  1951.        else
  1952. -        # We have old collect2
  1953. -        hardcode_direct=unsupported
  1954. +    # We have old collect2
  1955. +    hardcode_direct=unsupported
  1956.        fi
  1957.        archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts'
  1958.      else
  1959. -      archive_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
  1960. -      $CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry'
  1961. -      archive_sym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry'
  1962. +      always_export_symbols=yes
  1963. +      archive_expsym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry'
  1964.        hardcode_direct=yes
  1965.      fi
  1966.      hardcode_minus_L=yes
  1967. @@ -1166,54 +1172,22 @@
  1968.      hardcode_minus_L=yes
  1969.      ;;
  1970.  
  1971. -  cygwin32* | mingw32*)
  1972. -    if test "$with_gcc" = yes; then
  1973. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  1974. -      # no search path for DLLs.
  1975. -      hardcode_libdir_flag_spec='-L$libdir'
  1976. -      allow_undefined_flag=unsupported
  1977. -      # Very, very bogus.
  1978. -
  1979. -      archive_cmds='rm -f $objdir/$soname-ltdll.c~
  1980. -      sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  1981. -      (cd $objdir && $CC -c $soname-ltdll.c)~
  1982. -      echo EXPORTS > $objdir/$soname-def~
  1983. -      $DLLTOOL --export-all --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
  1984. -      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1985. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1986. -      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1987. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1988. -      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
  1989. -
  1990. -      archive_sym_cmds='rm -f $objdir/$soname-ltdll.c~
  1991. -      sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  1992. -      (cd $objdir && $CC -c $soname-ltdll.c)~
  1993. -      echo EXPORTS > $objdir/$soname-def~
  1994. -      cat "$export_symbols" >> $objdir/$soname-def~
  1995. -      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1996. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1997. -      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  1998. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  1999. -      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
  2000. -
  2001. -      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
  2002. -    else
  2003. -      # When not using gcc, we currently assume that we are using
  2004. -      # Microsoft Visual C++.
  2005. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  2006. -      # no search path for DLLs.
  2007. -      hardcode_libdir_flag_spec=' '
  2008. -      allow_undefined_flag=unsupported
  2009. -      # Tell ltmain to make .lib files, not .a files.
  2010. -      libext=lib
  2011. -      # FIXME: Setting linknames here is a bad hack.
  2012. -      archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  2013. -      # The linker will automatically build a .lib file if we build a DLL.
  2014. -      old_archive_from_new_cmds='true'
  2015. -      # FIXME: Should let the user specify the lib program.
  2016. -      old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  2017. -      fix_srcfile_path='`cygpath -w $srcfile`'
  2018. -    fi
  2019. +  cygwin* | mingw*)
  2020. +    # When not using gcc, we currently assume that we are using
  2021. +    # Microsoft Visual C++.
  2022. +    # hardcode_libdir_flag_spec is actually meaningless, as there is
  2023. +    # no search path for DLLs.
  2024. +    hardcode_libdir_flag_spec=' '
  2025. +    allow_undefined_flag=unsupported
  2026. +    # Tell ltmain to make .lib files, not .a files.
  2027. +    libext=lib
  2028. +    # FIXME: Setting linknames here is a bad hack.
  2029. +    archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  2030. +    # The linker will automatically build a .lib file if we build a DLL.
  2031. +    old_archive_from_new_cmds='true'
  2032. +    # FIXME: Should let the user specify the lib program.
  2033. +    old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  2034. +    fix_srcfile_path='`cygpath -w $srcfile`'
  2035.      ;;
  2036.  
  2037.    freebsd1*)
  2038. @@ -1268,11 +1242,12 @@
  2039.  
  2040.    irix5* | irix6*)
  2041.      if test "$with_gcc" = yes; then
  2042. -      archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring $libobjs $deplibs $linkopts'
  2043. +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
  2044.      else
  2045. -      archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring $libobjs $deplibs $linkopts'
  2046. +      archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
  2047.      fi
  2048.      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  2049. +    hardcode_libdir_separator=:
  2050.      ;;
  2051.  
  2052.    netbsd*)
  2053. @@ -1304,10 +1279,10 @@
  2054.    osf3* | osf4*)
  2055.      if test "$with_gcc" = yes; then
  2056.        allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  2057. -      archive_cmds='$CC -shared${allow_undefined_flag} -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring $libobjs $deplibs $linkopts'
  2058. +      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
  2059.      else
  2060.        allow_undefined_flag=' -expect_unresolved \*'
  2061. -      archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring $libobjs $deplibs $linkopts'
  2062. +      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
  2063.      fi
  2064.      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  2065.      hardcode_libdir_separator=:
  2066. @@ -1323,8 +1298,8 @@
  2067.      # $CC -shared without GNU ld will not create a library from C++
  2068.      # object files and a static libstdc++, better avoid it by now
  2069.      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
  2070. -    archive_sym_cmds='$echo "{ global:" > $lib.exp~sed $export_symbols -e "s/.*/\1;/" >> $lib.exp~$echo "local: * }" >> $lib.exp~
  2071. -        $LD -G${allow_undefined_flag} -M $export_symbols -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
  2072. +    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  2073. +        $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
  2074.      hardcode_libdir_flag_spec='-R$libdir'
  2075.      hardcode_shlibpath_var=no
  2076.      ;;
  2077. @@ -1419,16 +1394,22 @@
  2078.  sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  2079.  
  2080.  # Transform the above into a raw symbol and a C symbol.
  2081. -symxfrm='\1 \1'
  2082. +symxfrm='\1 \2\3 \3'
  2083. +
  2084. +# Transform an extracted symbol line into a proper C declaration
  2085. +global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
  2086.  
  2087.  # Define system-specific variables.
  2088.  case "$host_os" in
  2089.  aix*)
  2090.    symcode='[BCDT]'
  2091.    ;;
  2092. -cygwin32* | mingw32*)
  2093. +cygwin* | mingw*)
  2094.    symcode='[ABCDGISTW]'
  2095.    ;;
  2096. +hpux*) # Its linker distinguishes data from code symbols
  2097. +  global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
  2098. +  ;;
  2099.  irix*)
  2100.    symcode='[BCDEGRST]'
  2101.    ;;
  2102. @@ -1446,7 +1427,7 @@
  2103.  for ac_symprfx in "" "_"; do
  2104.  
  2105.    # Write the raw and C identifiers.
  2106. -  global_symbol_pipe="sed -n -e 's/^.* $symcode $ac_symprfx$sympat$/$symxfrm/p'"
  2107. +  global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode\)[     ][     ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
  2108.  
  2109.    # Check to see that the pipe works correctly.
  2110.    pipe_works=no
  2111. @@ -1463,11 +1444,11 @@
  2112.  main(){nm_test_var='a';nm_test_func();return(0);}
  2113.  EOF
  2114.  
  2115. -  echo "$progname:1466: checking if global_symbol_pipe works" >&5
  2116. -  if { (eval echo $progname:1467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
  2117. +  echo "$progname:1447: checking if global_symbol_pipe works" >&5
  2118. +  if { (eval echo $progname:1448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
  2119.      # Now try to grab the symbols.
  2120.      nlist=conftest.nm
  2121. -    if { echo "$progname:1470: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  2122. +    if { echo "$progname:1451: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  2123.  
  2124.        # Try sorting and uniquifying the output.
  2125.        if sort "$nlist" | uniq > "$nlist"T; then
  2126. @@ -1486,7 +1467,7 @@
  2127.  
  2128.  EOF
  2129.        # Now generate the symbol file.
  2130. -      sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
  2131. +      eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
  2132.  
  2133.        cat <<EOF >> conftest.c
  2134.  #if defined (__STDC__) && __STDC__
  2135. @@ -1504,7 +1485,7 @@
  2136.  lt_preloaded_symbols[] =
  2137.  {
  2138.  EOF
  2139. -      sed 's/^\(.*\) \(.*\)$/  {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
  2140. +      sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
  2141.        cat <<\EOF >> conftest.c
  2142.    {0, (lt_ptr_t) 0}
  2143.  };
  2144. @@ -1519,7 +1500,7 @@
  2145.        save_CFLAGS="$CFLAGS"
  2146.        LIBS="conftestm.$objext"
  2147.        CFLAGS="$CFLAGS$no_builtin_flag"
  2148. -      if { (eval echo $progname:1522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  2149. +      if { (eval echo $progname:1503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  2150.          pipe_works=yes
  2151.        else
  2152.          echo "$progname: failed program was:" >&5
  2153. @@ -1550,6 +1531,10 @@
  2154.  done
  2155.  echo "$ac_t$pipe_works" 1>&6
  2156.  
  2157. +if test -z "$global_symbol_pipe"; then
  2158. +  global_symbol_to_cdecl=
  2159. +fi
  2160. +
  2161.  # Check hardcoding attributes.
  2162.  echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
  2163.  hardcode_action=
  2164. @@ -1592,10 +1577,13 @@
  2165.  finish_cmds=
  2166.  finish_eval=
  2167.  shlibpath_var=
  2168. +shlibpath_overrides_runpath=unknown
  2169.  version_type=none
  2170.  dynamic_linker="$host_os ld.so"
  2171. +sys_lib_dlsearch_path_spec="/lib /usr/lib"
  2172.  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  2173. -file_magic_command=
  2174. +file_magic_cmd=
  2175. +file_magic_test_file=
  2176.  deplibs_check_method='unknown'
  2177.  # Need to set the preceding variable on all platforms that support
  2178.  # interlibrary dependencies.
  2179. @@ -1604,7 +1592,7 @@
  2180.  # 'pass_all' -- all dependencies passed with no checks.
  2181.  # 'test_compile' -- check by making test program.
  2182.  # 'file_magic [regex]' -- check by looking for files in library path
  2183. -# which responds to the $file_magic_command with a given egrep regex.
  2184. +# which responds to the $file_magic_cmd with a given egrep regex.
  2185.  # If you have `file' or equivalent on your system and you're not sure
  2186.  # whether `pass_all' will *always* work, you probably want this one.
  2187.  echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
  2188. @@ -1648,11 +1636,17 @@
  2189.    soname_spec='${libname}.so'
  2190.    finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir'
  2191.    shlibpath_var=LD_LIBRARY_PATH
  2192. -  check_shared_deplibs_method='file_magic ELF 32-bit LSB shared object'
  2193. -  sys_lib_search_path="/shlib /usr/lib /usr/local/lib"
  2194. +  deplibs_check_method='file_magic ELF 32-bit LSB shared object'
  2195. +  file_magic_cmd=/usr/bin/file
  2196. +  file_magic_test_file=/shlib/libc.so
  2197. +  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  2198. +  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  2199. +  # the default ld.so.conf also contains /usr/contrib/lib and
  2200. +  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  2201. +  # libtool to hard-code these into programs
  2202.    ;;
  2203.  
  2204. -cygwin32* | mingw32*)
  2205. +cygwin* | mingw*)
  2206.    version_type=windows
  2207.    if test "$with_gcc" = yes; then
  2208.      library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
  2209. @@ -1661,7 +1655,7 @@
  2210.    fi
  2211.    dynamic_linker='Win32 ld.exe'
  2212.    deplibs_check_method='file_magic file format pei*-i386.*architecture: i386'
  2213. -  file_magic_command='objdump -f'
  2214. +  file_magic_cmd='objdump -f'
  2215.    need_lib_prefix=no
  2216.    # FIXME: first we should search . and the directory the executable is in
  2217.    shlibpath_var=PATH
  2218. @@ -1677,16 +1671,20 @@
  2219.    case "$version_type" in
  2220.      freebsd-elf*)
  2221.        deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
  2222. -      file_magic_command=file
  2223. +      file_magic_cmd=/usr/bin/file
  2224. +      file_magic_test_file=`echo /usr/lib/libc.so*`
  2225. +      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  2226. +      need_version=no
  2227. +      need_lib_prefix=no
  2228.        ;;
  2229.      freebsd-*)
  2230.        deplibs_check_method=unknown
  2231. +      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
  2232. +      need_version=yes
  2233.        ;;
  2234.    esac
  2235. -  library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
  2236. -  finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="$objformat" ldconfig -m $libdir'
  2237. +  finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
  2238.    shlibpath_var=LD_LIBRARY_PATH
  2239. -  need_version=yes
  2240.    ;;
  2241.  
  2242.  gnu*)
  2243. @@ -1700,6 +1698,8 @@
  2244.    # link against other versions.
  2245.    dynamic_linker="$host_os dld.sl"
  2246.    version_type=sunos
  2247. +  need_lib_prefix=no
  2248. +  need_version=no
  2249.    shlibpath_var=SHLIB_PATH
  2250.    library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
  2251.    soname_spec='${libname}${release}.sl$major'
  2252. @@ -1708,17 +1708,39 @@
  2253.    ;;
  2254.  
  2255.  irix5*)
  2256. -  version_type=osf
  2257. +  version_type=irix
  2258.    soname_spec='${libname}${release}.so'
  2259. -  library_names_spec='${libname}${release}.so$versuffix $libname.so'
  2260. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  2261.    shlibpath_var=LD_LIBRARY_PATH
  2262. +  deplibs_check_method=pass_all
  2263. +  file_magic_cmd=/usr/bin/file
  2264. +  file_magic_test_file=`echo /lib/libc.so*`
  2265. +  shlibpath_overrides_runpath=no
  2266.    ;;
  2267.  
  2268.  irix6*)
  2269. -  version_type=osf
  2270. +  version_type=irix
  2271. +  need_lib_prefix=no
  2272. +  need_version=no
  2273.    soname_spec='${libname}${release}.so'
  2274.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  2275. -  shlibpath_var=LD_LIBRARYN32_PATH
  2276. +  case "$LD" in # libtool.m4 will add one of these switches to LD
  2277. +  *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
  2278. +  *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
  2279. +  *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
  2280. +  *) libsuff= shlibsuff= libmagic=never-match;;
  2281. +  esac
  2282. +  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  2283. +  shlibpath_overrides_runpath=no
  2284. +  # even though /usr/local/lib is always searched, the man-page says
  2285. +  # shared libraries should not be installed there if they use an ABI
  2286. +  # different from -32, so we'd better not search for shared libraries
  2287. +  # there either
  2288. +  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
  2289. +  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
  2290. +  deplibs_check_method=pass_all
  2291. +  file_magic_cmd=/usr/bin/file
  2292. +  file_magic_test_file=`echo /lib${libsuff}/libc.so*`
  2293.    ;;
  2294.  
  2295.  # No shared lib support for Linux oldld, aout, or coff.
  2296. @@ -1735,8 +1757,10 @@
  2297.    soname_spec='${libname}${release}.so$major'
  2298.    finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
  2299.    shlibpath_var=LD_LIBRARY_PATH
  2300. +  shlibpath_overrides_runpath=no
  2301.    deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
  2302. -  file_magic_command=file
  2303. +  file_magic_cmd=/usr/bin/file
  2304. +  file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  2305.  
  2306.    if test -f /lib/ld.so.1; then
  2307.      dynamic_linker='GNU ld.so'
  2308. @@ -1752,11 +1776,11 @@
  2309.  netbsd*)
  2310.    version_type=sunos
  2311.    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  2312. -    library_names_spec='${libname}${release}.so$versuffix'
  2313. +    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  2314.      finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
  2315.      dynamic_linker='NetBSD (a.out) ld.so'
  2316.    else
  2317. -    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so'
  2318. +    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
  2319.      soname_spec='${libname}${release}.so$major'
  2320.      dynamic_linker='NetBSD ld.elf_so'
  2321.    fi
  2322. @@ -1765,7 +1789,11 @@
  2323.  
  2324.  openbsd*)
  2325.    version_type=sunos
  2326. -  library_names_spec='${libname}${release}.so$versuffix'
  2327. +  if test "$with_gnu_ld" = yes; then
  2328. +    need_lib_prefix=no
  2329. +    need_version=no
  2330. +  fi
  2331. +  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  2332.    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2333.    shlibpath_var=LD_LIBRARY_PATH
  2334.    ;;
  2335. @@ -1783,7 +1811,16 @@
  2336.    soname_spec='${libname}${release}.so'
  2337.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  2338.    shlibpath_var=LD_LIBRARY_PATH
  2339. -  deplibs_check_method='pass_all'
  2340. +  # deplibs_check_method='pass_all'
  2341. +  # Although pass_all appears to work, it copies symbols from static libraries
  2342. +  # into shared ones and exports them.  So, when a program is linked with two
  2343. +  # or more libraries that have got copies of the same symbols, link fails
  2344. +  # This was only tested on osf4:
  2345. +  deplibs_check_method='file_magic COFF format alpha shared library'
  2346. +  file_magic_cmd=/usr/bin/file
  2347. +  file_magic_test_file=/shlib/libc.so
  2348. +  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  2349. +  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  2350.    ;;
  2351.  
  2352.  sco3.2v5*)
  2353. @@ -1800,10 +1837,12 @@
  2354.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2355.    soname_spec='${libname}${release}.so$major'
  2356.    shlibpath_var=LD_LIBRARY_PATH
  2357. +  shlibpath_overrides_runpath=yes
  2358.    # ldd complains unless libraries are executable
  2359.    postinstall_cmds='chmod +x $lib'
  2360.    deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
  2361. -  file_magic_command="file"
  2362. +  file_magic_cmd=/usr/bin/file
  2363. +  file_magic_test_file=/lib/libc.so
  2364.    ;;
  2365.  
  2366.  sunos4*)
  2367. @@ -1811,6 +1850,10 @@
  2368.    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  2369.    finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  2370.    shlibpath_var=LD_LIBRARY_PATH
  2371. +  shlibpath_overrides_runpath=yes
  2372. +  if test "$with_gnu_ld" = yes; then
  2373. +    need_lib_prefix=no
  2374. +  fi
  2375.    need_version=yes
  2376.    ;;
  2377.  
  2378. @@ -1828,13 +1871,15 @@
  2379.  
  2380.  uts4*)
  2381.    version_type=linux
  2382. -  library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so$major $libname.so'
  2383. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2384.    soname_spec='${libname}${release}.so$major'
  2385.    shlibpath_var=LD_LIBRARY_PATH
  2386.    ;;
  2387.  
  2388.  dgux*)
  2389.    version_type=linux
  2390. +  need_lib_prefix=no
  2391. +  need_version=no
  2392.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2393.    soname_spec='${libname}${release}.so$major'
  2394.    shlibpath_var=LD_LIBRARY_PATH
  2395. @@ -1850,6 +1895,30 @@
  2396.  # Report the final consequences.
  2397.  echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
  2398.  
  2399. +if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then
  2400. +  case "$deplibs_check_method" in
  2401. +  "file_magic "*)
  2402. +    file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
  2403. +    if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  2404. +       egrep "$file_magic_regex" > /dev/null; then
  2405. +      :
  2406. +    else
  2407. +      cat <<EOF 1>&2
  2408. +
  2409. +*** Warning: the command libtool uses to detect shared libraries,
  2410. +*** $file_magic_cmd, produces output that libtool cannot recognize.
  2411. +*** The result is that libtool may fail to recognize shared libraries
  2412. +*** as such.  This will affect the creation of libtool libraries that
  2413. +*** depend on shared libraries, but programs linked with such libtool
  2414. +*** libraries will work regardless of this problem.  Nevertheless, you
  2415. +*** may want to report the problem to your system manager and/or to
  2416. +*** bug-libtool@gnu.org
  2417. +
  2418. +EOF
  2419. +    fi ;;
  2420. +  esac
  2421. +fi
  2422. +
  2423.  echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
  2424.  test "$can_build_shared" = "no" && enable_shared=no
  2425.  
  2426. @@ -1876,6 +1945,15 @@
  2427.  
  2428.  echo "checking whether to build static libraries... $enable_static" 1>&6
  2429.  
  2430. +if test "$hardcode_action" = relink; then
  2431. +  # Fast installation is not supported
  2432. +  enable_fast_install=no
  2433. +elif test "$shlibpath_overrides_runpath" = yes ||
  2434. +     test "$enable_shared" = no; then
  2435. +  # Fast installation is not necessary
  2436. +  enable_fast_install=needless
  2437. +fi
  2438. +
  2439.  echo $ac_n "checking for objdir... $ac_c" 1>&6
  2440.  rm -f .libs 2>/dev/null
  2441.  mkdir .libs 2>/dev/null
  2442. @@ -1888,6 +1966,442 @@
  2443.  rmdir .libs 2>/dev/null
  2444.  echo "$ac_t$objdir" 1>&6
  2445.  
  2446. +if test "x$enable_dlopen" != xyes; then
  2447. +  enable_dlopen=unknown
  2448. +  enable_dlopen_self=unknown
  2449. +  enable_dlopen_self_static=unknown
  2450. +else
  2451. +if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
  2452. +  lt_cv_dlopen=no lt_cv_dlopen_libs=
  2453. +echo $ac_n "checking for dlopen""... $ac_c" 1>&6
  2454. +echo "$progname:1977: checking for dlopen" >&5
  2455. +if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
  2456. +  echo $ac_n "(cached) $ac_c" 1>&6
  2457. +else
  2458. +  cat > conftest.$ac_ext <<EOF
  2459. +#line 1982 "ltconfig"
  2460. +/* System header to define __stub macros and hopefully few prototypes,
  2461. +    which can conflict with char dlopen(); below.  */
  2462. +#include <assert.h>
  2463. +/* Override any gcc2 internal prototype to avoid an error.  */
  2464. +/* We use char because int might match the return type of a gcc2
  2465. +    builtin and then its argument prototype would still apply.  */
  2466. +char dlopen();
  2467. +
  2468. +int main() {
  2469. +
  2470. +/* The GNU C library defines this for functions which it implements
  2471. +    to always fail with ENOSYS.  Some functions are actually named
  2472. +    something starting with __ and the normal name is an alias.  */
  2473. +#if defined (__stub_dlopen) || defined (__stub___dlopen)
  2474. +choke me
  2475. +#else
  2476. +dlopen();
  2477. +#endif
  2478. +
  2479. +; return 0; }
  2480. +EOF
  2481. +if { (eval echo $progname:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  2482. +  rm -rf conftest*
  2483. +  eval "ac_cv_func_dlopen=yes"
  2484. +else
  2485. +  echo "$progname: failed program was:" >&5
  2486. +  cat conftest.$ac_ext >&5
  2487. +  rm -rf conftest*
  2488. +  eval "ac_cv_func_dlopen=no"
  2489. +fi
  2490. +rm -f conftest*
  2491. +fi
  2492. +
  2493. +if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
  2494. +  echo "$ac_t""yes" 1>&6
  2495. +  lt_cv_dlopen="dlopen"
  2496. +else
  2497. +  echo "$ac_t""no" 1>&6
  2498. +echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
  2499. +echo "$progname:2022: checking for dlopen in -ldl" >&5
  2500. +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
  2501. +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  2502. +  echo $ac_n "(cached) $ac_c" 1>&6
  2503. +else
  2504. +  ac_save_LIBS="$LIBS"
  2505. +LIBS="-ldl  $LIBS"
  2506. +cat > conftest.$ac_ext <<EOF
  2507. +#line 2030 "ltconfig"
  2508. +/* Override any gcc2 internal prototype to avoid an error.  */
  2509. +/* We use char because int might match the return type of a gcc2
  2510. +    builtin and then its argument prototype would still apply.  */
  2511. +char dlopen();
  2512. +
  2513. +int main() {
  2514. +dlopen()
  2515. +; return 0; }
  2516. +EOF
  2517. +if { (eval echo $progname:2040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  2518. +  rm -rf conftest*
  2519. +  eval "ac_cv_lib_$ac_lib_var=yes"
  2520. +else
  2521. +  echo "$progname: failed program was:" >&5
  2522. +  cat conftest.$ac_ext >&5
  2523. +  rm -rf conftest*
  2524. +  eval "ac_cv_lib_$ac_lib_var=no"
  2525. +fi
  2526. +rm -f conftest*
  2527. +LIBS="$ac_save_LIBS"
  2528. +
  2529. +fi
  2530. +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  2531. +  echo "$ac_t""yes" 1>&6
  2532. +  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
  2533. +else
  2534. +  echo "$ac_t""no" 1>&6
  2535. +echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
  2536. +echo "$progname:2059: checking for dld_link in -ldld" >&5
  2537. +ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
  2538. +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  2539. +  echo $ac_n "(cached) $ac_c" 1>&6
  2540. +else
  2541. +  ac_save_LIBS="$LIBS"
  2542. +LIBS="-ldld  $LIBS"
  2543. +cat > conftest.$ac_ext <<EOF
  2544. +#line 2067 "ltconfig"
  2545. +/* Override any gcc2 internal prototype to avoid an error.  */
  2546. +/* We use char because int might match the return type of a gcc2
  2547. +    builtin and then its argument prototype would still apply.  */
  2548. +char dld_link();
  2549. +
  2550. +int main() {
  2551. +dld_link()
  2552. +; return 0; }
  2553. +EOF
  2554. +if { (eval echo $progname:2077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  2555. +  rm -rf conftest*
  2556. +  eval "ac_cv_lib_$ac_lib_var=yes"
  2557. +else
  2558. +  echo "$progname: failed program was:" >&5
  2559. +  cat conftest.$ac_ext >&5
  2560. +  rm -rf conftest*
  2561. +  eval "ac_cv_lib_$ac_lib_var=no"
  2562. +fi
  2563. +rm -f conftest*
  2564. +LIBS="$ac_save_LIBS"
  2565. +
  2566. +fi
  2567. +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  2568. +  echo "$ac_t""yes" 1>&6
  2569. +  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
  2570. +else
  2571. +  echo "$ac_t""no" 1>&6
  2572. +echo $ac_n "checking for shl_load""... $ac_c" 1>&6
  2573. +echo "$progname:2096: checking for shl_load" >&5
  2574. +if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
  2575. +  echo $ac_n "(cached) $ac_c" 1>&6
  2576. +else
  2577. +  cat > conftest.$ac_ext <<EOF
  2578. +#line 2101 "ltconfig"
  2579. +/* System header to define __stub macros and hopefully few prototypes,
  2580. +    which can conflict with char shl_load(); below.  */
  2581. +#include <assert.h>
  2582. +/* Override any gcc2 internal prototype to avoid an error.  */
  2583. +/* We use char because int might match the return type of a gcc2
  2584. +    builtin and then its argument prototype would still apply.  */
  2585. +char shl_load();
  2586. +
  2587. +int main() {
  2588. +
  2589. +/* The GNU C library defines this for functions which it implements
  2590. +    to always fail with ENOSYS.  Some functions are actually named
  2591. +    something starting with __ and the normal name is an alias.  */
  2592. +#if defined (__stub_shl_load) || defined (__stub___shl_load)
  2593. +choke me
  2594. +#else
  2595. +shl_load();
  2596. +#endif
  2597. +
  2598. +; return 0; }
  2599. +EOF
  2600. +if { (eval echo $progname:2123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  2601. +  rm -rf conftest*
  2602. +  eval "ac_cv_func_shl_load=yes"
  2603. +else
  2604. +  echo "$progname: failed program was:" >&5
  2605. +  cat conftest.$ac_ext >&5
  2606. +  rm -rf conftest*
  2607. +  eval "ac_cv_func_shl_load=no"
  2608. +fi
  2609. +rm -f conftest*
  2610. +fi
  2611. +
  2612. +if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
  2613. +  echo "$ac_t""yes" 1>&6
  2614. +  lt_cv_dlopen="shl_load"
  2615. +else
  2616. +  echo "$ac_t""no" 1>&6
  2617. +echo $ac_n "checking for LoadLibrary""... $ac_c" 1>&6
  2618. +echo "$progname:2141: checking for LoadLibrary" >&5
  2619. +if eval "test \"`echo '$''{'ac_cv_func_LoadLibrary'+set}'`\" = set"; then
  2620. +  echo $ac_n "(cached) $ac_c" 1>&6
  2621. +else
  2622. +  cat > conftest.$ac_ext <<EOF
  2623. +#line 2146 "ltconfig"
  2624. +/* System header to define __stub macros and hopefully few prototypes,
  2625. +    which can conflict with char LoadLibrary(); below.  */
  2626. +#include <assert.h>
  2627. +/* Override any gcc2 internal prototype to avoid an error.  */
  2628. +/* We use char because int might match the return type of a gcc2
  2629. +    builtin and then its argument prototype would still apply.  */
  2630. +char LoadLibrary();
  2631. +
  2632. +int main() {
  2633. +
  2634. +/* The GNU C library defines this for functions which it implements
  2635. +    to always fail with ENOSYS.  Some functions are actually named
  2636. +    something starting with __ and the normal name is an alias.  */
  2637. +#if defined (__stub_LoadLibrary) || defined (__stub___LoadLibrary)
  2638. +choke me
  2639. +#else
  2640. +LoadLibrary();
  2641. +#endif
  2642. +
  2643. +; return 0; }
  2644. +EOF
  2645. +if { (eval echo $progname:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  2646. +  rm -rf conftest*
  2647. +  eval "ac_cv_func_LoadLibrary=yes"
  2648. +else
  2649. +  echo "$progname: failed program was:" >&5
  2650. +  cat conftest.$ac_ext >&5
  2651. +  rm -rf conftest*
  2652. +  eval "ac_cv_func_LoadLibrary=no"
  2653. +fi
  2654. +rm -f conftest*
  2655. +fi
  2656. +
  2657. +if eval "test \"`echo '$ac_cv_func_'LoadLibrary`\" = yes"; then
  2658. +  echo "$ac_t""yes" 1>&6
  2659. +  lt_cv_dlopen="LoadLibrary"
  2660. +else
  2661. +  echo "$ac_t""no" 1>&6
  2662. +fi
  2663. +
  2664. +      
  2665. +fi
  2666. +
  2667. +    
  2668. +fi
  2669. +
  2670. +  
  2671. +fi
  2672. +
  2673. +
  2674. +fi
  2675. +
  2676. +fi
  2677. +
  2678. +  if test "x$lt_cv_dlopen" != xno; then
  2679. +    enable_dlopen=yes
  2680. +  fi
  2681. +
  2682. +  case "$lt_cv_dlopen" in
  2683. +  dlopen)
  2684. +for ac_hdr in dlfcn.h; do
  2685. +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  2686. +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  2687. +echo "$progname:2210: checking for $ac_hdr" >&5
  2688. +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  2689. +  echo $ac_n "(cached) $ac_c" 1>&6
  2690. +else
  2691. +  cat > conftest.$ac_ext <<EOF
  2692. +#line 2215 "ltconfig"
  2693. +#include <$ac_hdr>
  2694. +int fnord = 0;
  2695. +EOF
  2696. +ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out"
  2697. +{ (eval echo $progname:2220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  2698. +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  2699. +if test -z "$ac_err"; then
  2700. +  rm -rf conftest*
  2701. +  eval "ac_cv_header_$ac_safe=yes"
  2702. +else
  2703. +  echo "$ac_err" >&5
  2704. +  echo "$progname: failed program was:" >&5
  2705. +  cat conftest.$ac_ext >&5
  2706. +  rm -rf conftest*
  2707. +  eval "ac_cv_header_$ac_safe=no"
  2708. +fi
  2709. +rm -f conftest*
  2710. +fi
  2711. +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  2712. +  echo "$ac_t""yes" 1>&6
  2713. +else
  2714. +  echo "$ac_t""no" 1>&6
  2715. +fi
  2716. +done
  2717. +
  2718. +    if test "x$ac_cv_header_dlfcn_h" = xyes; then
  2719. +      CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  2720. +    fi
  2721. +    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  2722. +    LIBS="$lt_cv_dlopen_libs $LIBS"
  2723. +
  2724. +  echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
  2725. +echo "$progname:2248: checking whether a program can dlopen itself" >&5
  2726. +if test "${lt_cv_dlopen_self+set}" = set; then
  2727. +  echo $ac_n "(cached) $ac_c" 1>&6
  2728. +else
  2729. +  if test "$cross_compiling" = yes; then
  2730. +    lt_cv_dlopen_self=cross
  2731. +  else
  2732. +    cat > conftest.c <<EOF
  2733. +#line 2256 "ltconfig"
  2734. +
  2735. +#if HAVE_DLFCN_H
  2736. +#include <dlfcn.h>
  2737. +#endif
  2738. +
  2739. +#include <stdio.h>
  2740. +
  2741. +#ifdef RTLD_GLOBAL
  2742. +# define LTDL_GLOBAL    RTLD_GLOBAL
  2743. +#else
  2744. +# ifdef DL_GLOBAL
  2745. +#  define LTDL_GLOBAL    DL_GLOBAL
  2746. +# else
  2747. +#  define LTDL_GLOBAL    0
  2748. +# endif
  2749. +#endif
  2750. +
  2751. +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
  2752. +   find out it does not work in some platform. */
  2753. +#ifndef LTDL_LAZY_OR_NOW
  2754. +# ifdef RTLD_LAZY
  2755. +#  define LTDL_LAZY_OR_NOW    RTLD_LAZY
  2756. +# else
  2757. +#  ifdef DL_LAZY
  2758. +#   define LTDL_LAZY_OR_NOW    DL_LAZY
  2759. +#  else
  2760. +#   ifdef RTLD_NOW
  2761. +#    define LTDL_LAZY_OR_NOW    RTLD_NOW
  2762. +#   else
  2763. +#    ifdef DL_NOW
  2764. +#     define LTDL_LAZY_OR_NOW    DL_NOW
  2765. +#    else
  2766. +#     define LTDL_LAZY_OR_NOW    0
  2767. +#    endif
  2768. +#   endif
  2769. +#  endif
  2770. +# endif
  2771. +#endif
  2772. +
  2773. +fnord() { int i=42;}
  2774. +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
  2775. +    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
  2776. +           if(ptr1 || ptr2) exit(0); } exit(1); } 
  2777. +
  2778. +EOF
  2779. +if { (eval echo $progname:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
  2780. +then
  2781. +  lt_cv_dlopen_self=yes
  2782. +else
  2783. +  echo "$progname: failed program was:" >&5
  2784. +  cat conftest.$ac_ext >&5
  2785. +  rm -fr conftest*
  2786. +  lt_cv_dlopen_self=no
  2787. +fi
  2788. +rm -fr conftest*
  2789. +fi
  2790. +
  2791. +fi
  2792. +
  2793. +echo "$ac_t""$lt_cv_dlopen_self" 1>&6
  2794. +
  2795. +  if test "$lt_cv_dlopen_self" = yes; then
  2796. +    LDFLAGS="$LDFLAGS $link_static_flag"
  2797. +  echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
  2798. +echo "$progname:2321: checking whether a statically linked program can dlopen itself" >&5
  2799. +if test "${lt_cv_dlopen_self_static+set}" = set; then
  2800. +  echo $ac_n "(cached) $ac_c" 1>&6
  2801. +else
  2802. +  if test "$cross_compiling" = yes; then
  2803. +    lt_cv_dlopen_self_static=cross
  2804. +  else
  2805. +    cat > conftest.c <<EOF
  2806. +#line 2329 "ltconfig"
  2807. +
  2808. +#if HAVE_DLFCN_H
  2809. +#include <dlfcn.h>
  2810. +#endif
  2811. +
  2812. +#include <stdio.h>
  2813. +
  2814. +#ifdef RTLD_GLOBAL
  2815. +# define LTDL_GLOBAL    RTLD_GLOBAL
  2816. +#else
  2817. +# ifdef DL_GLOBAL
  2818. +#  define LTDL_GLOBAL    DL_GLOBAL
  2819. +# else
  2820. +#  define LTDL_GLOBAL    0
  2821. +# endif
  2822. +#endif
  2823. +
  2824. +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
  2825. +   find out it does not work in some platform. */
  2826. +#ifndef LTDL_LAZY_OR_NOW
  2827. +# ifdef RTLD_LAZY
  2828. +#  define LTDL_LAZY_OR_NOW    RTLD_LAZY
  2829. +# else
  2830. +#  ifdef DL_LAZY
  2831. +#   define LTDL_LAZY_OR_NOW    DL_LAZY
  2832. +#  else
  2833. +#   ifdef RTLD_NOW
  2834. +#    define LTDL_LAZY_OR_NOW    RTLD_NOW
  2835. +#   else
  2836. +#    ifdef DL_NOW
  2837. +#     define LTDL_LAZY_OR_NOW    DL_NOW
  2838. +#    else
  2839. +#     define LTDL_LAZY_OR_NOW    0
  2840. +#    endif
  2841. +#   endif
  2842. +#  endif
  2843. +# endif
  2844. +#endif
  2845. +
  2846. +fnord() { int i=42;}
  2847. +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
  2848. +    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
  2849. +    if(ptr1 || ptr2) exit(0); } exit(1); } 
  2850. +
  2851. +EOF
  2852. +if { (eval echo $progname:2375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
  2853. +then
  2854. +  lt_cv_dlopen_self_static=yes
  2855. +else
  2856. +  echo "$progname: failed program was:" >&5
  2857. +  cat conftest.$ac_ext >&5
  2858. +  rm -fr conftest*
  2859. +  lt_cv_dlopen_self_static=no
  2860. +fi
  2861. +rm -fr conftest*
  2862. +fi
  2863. +
  2864. +fi
  2865. +
  2866. +echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
  2867. +fi
  2868. +    ;;
  2869. +  esac
  2870. +
  2871. +  case "$lt_cv_dlopen_self" in
  2872. +  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  2873. +  *) enable_dlopen_self=unknown ;;
  2874. +  esac
  2875. +
  2876. +  case "$lt_cv_dlopen_self_static" in
  2877. +  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  2878. +  *) enable_dlopen_self_static=unknown ;;
  2879. +  esac
  2880. +fi
  2881. +
  2882.  # Copy echo and quote the copy, instead of the original, because it is
  2883.  # used later.
  2884.  ltecho="$echo"
  2885. @@ -1909,20 +2423,21 @@
  2886.      thread_safe_flag_spec whole_archive_flag_spec libname_spec \
  2887.      library_names_spec soname_spec \
  2888.      RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
  2889. -    old_postuninstall_cmds archive_cmds archive_sym_cmds postinstall_cmds postuninstall_cmds \
  2890. -    file_magic_command deplibs_check_method allow_undefined_flag no_undefined_flag \
  2891. -    finish_cmds finish_eval global_symbol_pipe hardcode_libdir_flag_spec \
  2892. -    hardcode_libdir_separator sys_lib_search_path_spec \
  2893. -    compiler_c_o compiler_o_lo need_locks; do
  2894. +    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
  2895. +    file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
  2896. +    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
  2897. +    hardcode_libdir_flag_spec hardcode_libdir_separator  \
  2898. +    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
  2899. +    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
  2900.  
  2901.      case "$var" in
  2902.      reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
  2903.      old_postinstall_cmds | old_postuninstall_cmds | \
  2904. -    archive_cmds | archive_sym_cmds | \
  2905. +    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
  2906.      postinstall_cmds | postuninstall_cmds | \
  2907. -    finish_cmds | sys_lib_search_path_spec)
  2908. +    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
  2909.        # Double-quote double-evaled strings.
  2910. -      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`\\\""
  2911. +      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
  2912.        ;;
  2913.      *)
  2914.        eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
  2915. @@ -1932,8 +2447,7 @@
  2916.  
  2917.    case "$ltecho" in
  2918.    *'\$0 --fallback-echo"')
  2919. -    ltecho=`$echo "X$ltecho" |
  2920. -        $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
  2921. +    ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
  2922.      ;;
  2923.    esac
  2924.  
  2925. @@ -2023,6 +2537,9 @@
  2926.  # Whether or not to build static libraries.
  2927.  build_old_libs=$enable_static
  2928.  
  2929. +# Whether or not to optimize for fast installation.
  2930. +fast_install=$enable_fast_install
  2931. +
  2932.  # The host system.
  2933.  host_alias=$host_alias
  2934.  host=$host
  2935. @@ -2045,10 +2562,10 @@
  2936.  # A BSD-compatible nm program.
  2937.  NM=$NM
  2938.  
  2939. -# Used on cygwin32: DLL creation program.
  2940. +# Used on cygwin: DLL creation program.
  2941.  DLLTOOL="$DLLTOOL"
  2942.  
  2943. -# Used on cygwin32: assembler.
  2944. +# Used on cygwin: assembler.
  2945.  AS="$AS"
  2946.  
  2947.  # The name of the directory that contains temporary libtool files.
  2948. @@ -2085,6 +2602,15 @@
  2949.  # Do we need a version for libraries?
  2950.  need_version=$need_version
  2951.  
  2952. +# Whether dlopen is supported.
  2953. +dlopen=$enable_dlopen
  2954. +
  2955. +# Whether dlopen of programs is supported.
  2956. +dlopen_self=$enable_dlopen_self
  2957. +
  2958. +# Whether dlopen of statically linked programs is supported.
  2959. +dlopen_self_static=$enable_dlopen_self_static
  2960. +
  2961.  # Compiler flag to prevent dynamic linking.
  2962.  link_static_flag=$link_static_flag
  2963.  
  2964. @@ -2124,7 +2650,7 @@
  2965.  
  2966.  # Commands used to build and install a shared archive.
  2967.  archive_cmds=$archive_cmds
  2968. -archive_sym_cmds=$archive_sym_cmds
  2969. +archive_expsym_cmds=$archive_expsym_cmds
  2970.  postinstall_cmds=$postinstall_cmds
  2971.  postuninstall_cmds=$postuninstall_cmds
  2972.  
  2973. @@ -2132,7 +2658,7 @@
  2974.  deplibs_check_method=$deplibs_check_method
  2975.  
  2976.  # Command to use when deplibs_check_method == file_magic
  2977. -file_magic_command=$file_magic_command
  2978. +file_magic_cmd=$file_magic_cmd
  2979.  
  2980.  # Flag that allows shared libraries with undefined symbols to be built.
  2981.  allow_undefined_flag=$allow_undefined_flag
  2982. @@ -2149,12 +2675,18 @@
  2983.  # Take the output of nm and produce a listing of raw symbols and C names.
  2984.  global_symbol_pipe=$global_symbol_pipe
  2985.  
  2986. +# Transform the output of nm in a proper C declaration
  2987. +global_symbol_to_cdecl=$global_symbol_to_cdecl
  2988. +
  2989.  # This is the shared library runtime path variable.
  2990.  runpath_var=$runpath_var
  2991.  
  2992.  # This is the shared library path variable.
  2993.  shlibpath_var=$shlibpath_var
  2994.  
  2995. +# Is shlibpath searched before the hard-coded library search path?
  2996. +shlibpath_overrides_runpath=$shlibpath_overrides_runpath
  2997. +
  2998.  # How to hardcode a shared library path into an executable.
  2999.  hardcode_action=$hardcode_action
  3000.  
  3001. @@ -2177,11 +2709,27 @@
  3002.  # the resulting binary.
  3003.  hardcode_shlibpath_var=$hardcode_shlibpath_var
  3004.  
  3005. -# System search path for libraries
  3006. +# Compile-time system search path for libraries
  3007.  sys_lib_search_path_spec=$sys_lib_search_path_spec
  3008.  
  3009. +# Run-time system search path for libraries
  3010. +sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
  3011. +
  3012.  # Fix the shell variable \$srcfile for the compiler.
  3013.  fix_srcfile_path="$fix_srcfile_path"
  3014. +
  3015. +# Set to yes if exported symbols are required
  3016. +always_export_symbols=$always_export_symbols
  3017. +
  3018. +# The command to extract exported symbols
  3019. +export_symbols_cmds=$export_symbols_cmds
  3020. +
  3021. +# Symbols that should not be listed in the preloaded symbols
  3022. +exclude_expsyms=$exclude_expsyms
  3023. +
  3024. +# Symbols that must always be exported
  3025. +include_expsyms=$include_expsyms
  3026. +
  3027.  EOF
  3028.  
  3029.  case "$ltmain" in
  3030. @@ -2214,6 +2762,58 @@
  3031.    echo "FIXME: would compile $ltmain"
  3032.    ;;
  3033.  esac
  3034. +
  3035. +test -n "$cache_file" || exit 0
  3036. +
  3037. +# AC_CACHE_SAVE
  3038. +trap '' 1 2 15
  3039. +cat > confcache <<\EOF
  3040. +# This file is a shell script that caches the results of configure
  3041. +# tests run on this system so they can be shared between configure
  3042. +# scripts and configure runs.  It is not useful on other systems.
  3043. +# If it contains results you don't want to keep, you may remove or edit it.
  3044. +#
  3045. +# By default, configure uses ./config.cache as the cache file,
  3046. +# creating it if it does not exist already.  You can give configure
  3047. +# the --cache-file=FILE option to use a different cache file; that is
  3048. +# what configure does when it calls configure scripts in
  3049. +# subdirectories, so they share the cache.
  3050. +# Giving --cache-file=/dev/null disables caching, for debugging configure.
  3051. +# config.status only pays attention to the cache file if you give it the
  3052. +# --recheck option to rerun configure.
  3053. +#
  3054. +EOF
  3055. +# The following way of writing the cache mishandles newlines in values,
  3056. +# but we know of no workaround that is simple, portable, and efficient.
  3057. +# So, don't put newlines in cache variables' values.
  3058. +# Ultrix sh set writes to stderr and can't be redirected directly,
  3059. +# and sets the high bit in the cache file unless we assign to the vars.
  3060. +(set) 2>&1 |
  3061. +  case `(ac_space=' '; set | grep ac_space) 2>&1` in
  3062. +  *ac_space=\ *)
  3063. +    # `set' does not quote correctly, so add quotes (double-quote substitution
  3064. +    # turns \\\\ into \\, and sed turns \\ into \).
  3065. +    sed -n \
  3066. +      -e "s/'/'\\\\''/g" \
  3067. +      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
  3068. +    ;;
  3069. +  *)
  3070. +    # `set' quotes correctly as required by POSIX, so do not add quotes.
  3071. +    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
  3072. +    ;;
  3073. +  esac >> confcache
  3074. +if cmp -s $cache_file confcache; then
  3075. +  :
  3076. +else
  3077. +  if test -w $cache_file; then
  3078. +    echo "updating cache $cache_file"
  3079. +    cat confcache > $cache_file
  3080. +  else
  3081. +    echo "not updating unwritable cache $cache_file"
  3082. +  fi
  3083. +fi
  3084. +rm -f confcache
  3085. +
  3086.  exit 0
  3087.  
  3088.  # Local Variables:
  3089. --- ./configure    Wed Feb 24 18:44:38 1999
  3090. +++ ../imlib-1.9.4/./configure    Wed Apr 14 14:04:31 1999
  3091. @@ -2298,14 +2298,18 @@
  3092.    rm -f conf.gtktest
  3093.  
  3094.  
  3095. +if test "x$GLIB_CONFIG" == x; then
  3096. +  GLIB_CONFIG=glib-config
  3097. +fi
  3098. +
  3099.  dynworks=false
  3100.  if test "x$GDK_IMLIB" != x; then
  3101.    echo $ac_n "checking If dynamic linking works on this system""... $ac_c" 1>&6
  3102.  echo "configure:2305: checking If dynamic linking works on this system" >&5
  3103.    oLIBS="$LIBS"
  3104.    oCFLAGS="$CFLAGS"
  3105. -  LIBS="$LIBS `glib-config --libs gmodule`"
  3106. -  CFLAGS="$CFLAGS `glib-config --cflags gmodule`"
  3107. +  LIBS="$LIBS `$GLIB_CONFIG --libs gmodule`"
  3108. +  CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gmodule`"
  3109.    if test "$cross_compiling" = yes; then
  3110.      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  3111.  else
  3112. @@ -2354,8 +2358,8 @@
  3113.  #define USE_GMODULE 1
  3114.  EOF
  3115.  
  3116. -   GMODULE_LIBS="`glib-config --libs gmodule`"
  3117. -   GMODULE_FLAGS="`glib-config --cflags gmodule`"
  3118. +   GMODULE_LIBS="`$GLIB_CONFIG --libs gmodule`"
  3119. +   GMODULE_FLAGS="`$GLIB_CONFIG --cflags gmodule`"
  3120.     
  3121.     
  3122.     echo "$ac_t""yes" 1>&6
  3123.